401 Unauthorized
result.
aud
, array of strings) depends on the initial token request. The aud
field could contain both an audience corresponding to your custom API and an audience corresponding to the /userinfo
endpoint. At least one of the audience values for the token must match the unique identifier of the target API as defined in your API’s Settings in the Identifier field. See Get Access Tokens for details.
scope
claim (scope
, space-separated list of strings) in the decoded JWT’s payload. It should match the permissions required for the endpoint being accessed. For example, if your custom API provides three endpoints to read, create, or delete a user record, when you registered your API with Auth0, you created three corresponding permissions:
create:users
provides access to the /create
endpointread:users
provides access to the /read
endpointdelete:users
provides access to the /delete
endpoint/create
endpoint, but the access token’s scope
claim does not include the value create:users
, then the API should reject the request.