Tests for API Quickstart samples.
Clone the repo and install the dependencies.
npm install
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
andwrite:messages
.
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
andAUTH0_CLIENT_SECRET_1
with client id and client secret from the client without any scope granted.AUTH0_CLIENT_ID_2
andAUTH0_CLIENT_SECRET_2
with client id and client secret from the client with a scope ofread:messages
granted.AUTH0_CLIENT_ID_3
andAUTH0_CLIENT_SECRET_3
with client id and client secret from the client with a scope ofwrite:messages
granted.AUTH0_CLIENT_ID_4
andAUTH0_CLIENT_SECRET_4
with client id and client secret from the client with the scopes ofread:messages
andwrite:messages
granted.
In order to run the tests execute:
npm test