Skip to content

aaguiarz/auth0-test-api-quickstarts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Quickstart Tests

Tests for API Quickstart samples.

Getting Started

Clone the repo and install the dependencies.

npm install

Configure Auth0's API and Clients

Create an API, and set the scopes of read:messages and write:messages.

Create four clients of type Non Interactive Clients.

Configure the following grant between clients and API:

  • A client grant without any scope.
  • A client grant with a scope of read:messages.
  • A client grant with a scope of write:messages.
  • A client grant with the scopes of read:messages and write:messages.

Set up the .env file

Rename .env.example to .env and replace the values for variables:

  • AUTH0_DOMAIN with your Auth0's domain.
  • AUTH0_AUDIENCE with your api identifier configured above.
  • AUTH0_CLIENT_ID_1 and AUTH0_CLIENT_SECRET_1 with client id and client secret from the client without any scope granted.
  • AUTH0_CLIENT_ID_2 and AUTH0_CLIENT_SECRET_2 with client id and client secret from the client with a scope of read:messages granted.
  • AUTH0_CLIENT_ID_3 and AUTH0_CLIENT_SECRET_3 with client id and client secret from the client with a scope of write:messages granted.
  • AUTH0_CLIENT_ID_4 and AUTH0_CLIENT_SECRET_4 with client id and client secret from the client with the scopes of read:messages and write:messages granted.

Running the tests

In order to run the tests execute:

npm test

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.2%
  • Shell 3.8%