When I use the authorization code flow. The returned identity token does not include the requested custom scopes. These scopes are configured for both the api and the user. When using the implicit flow the scopes are included in the returned token.
Does the authorization code flow behave differently in this regard ?
Or perhaps there some error in configuration ?
scope: âopenid profile email myscopeâ,
responseType: âcodeâ,
customQueryParams: {
// Your APIâs name
audience: âmyapiurlâ
},
};
The client library is configured to use authorization code flow with PKCE. The problem that we have is that when the authorization code is exchanged, the response that comes back has some problems:
The scope field does not contain the requested custom scope âmyscopeâ which has been added to both the API and the user in the Auth0 dashboard.
The returned access token is not a valid JWT, here is an example access_token=x8IUDEHkXbfRx_6znvao4PDSYsi0ATzf and a full response is below:
See this page: Sample Use Cases: Scopes and Claims
You probably need to define the scope. Youâll also need to specify the audience (and that is why the access token is not a valid JWT).
You might consider switching to Auth0âs Quickstart for Angular.