Tests for API Quickstart samples.
Clone the repo and install the dependencies.
npm installCreate 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:messagesandwrite:messages.
Rename .env.example to .env and replace the values for variables:
AUTH0_DOMAINwith your Auth0's domain.AUTH0_AUDIENCEwith your api identifier configured above.AUTH0_CLIENT_ID_1andAUTH0_CLIENT_SECRET_1with client id and client secret from the client without any scope granted.AUTH0_CLIENT_ID_2andAUTH0_CLIENT_SECRET_2with client id and client secret from the client with a scope ofread:messagesgranted.AUTH0_CLIENT_ID_3andAUTH0_CLIENT_SECRET_3with client id and client secret from the client with a scope ofwrite:messagesgranted.AUTH0_CLIENT_ID_4andAUTH0_CLIENT_SECRET_4with client id and client secret from the client with the scopes ofread:messagesandwrite:messagesgranted.
In order to run the tests execute:
npm testNote: Returned error codes from the Symfony API are different from the standard. For those cases execute:
quickstart="symfony" npm test