I created a new Application and API while following Auth0 tutorials and tokens requested from my Angular web application come with no payload in the access_token portion of the response.
id_token has a payload.  Are there settings necessary to add roles, permissions, claims to the payload or enable the payload too be added to the JWT on an application (NOT on an API).
             
            
              1 Like 
            
            
           
          
            
            
              Hi @Blissitte ,
Welcome to the Auth0 Community!
I understand that you have encountered issues getting a working access token.
Before we continue, could you please clarify the /authorize and /oauth/token requests that you made?
For example:
https://YOUR_DOMAIN/authorize?
    response_type=code&
    client_id=YOUR_CLIENT_ID&
    redirect_uri=https://YOUR_APP/callback&
    scope=SCOPE&
    audience=API_AUDIENCE&
    state=STATE
and
curl --request POST \
  --url 'https://YOUR_DOMAIN/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data grant_type=authorization_code \
  --data 'client_id=YOUR_CLIENT_ID' \
  --data client_secret=YOUR_CLIENT_SECRET \
  --data code=YOUR_AUTHORIZATION_CODE \
  --data 'redirect_uri=https://YOUR_APP/callback'
https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-authorization-code-flow 
Looking forward to your response.
Thanks.
             
            
              1 Like 
            
            
           
          
            
            
              Certainly, I am using the auth0-angular package so our authorize request looks like so:
https://dev-u3c56kd8.us.auth0.com/authorize?redirect_uri=http://localhost:4200 
 
And the token request looks like so:
curl “https://dev-u3c56kd8.us.auth0.com/oauth/token ” ^dev-u3c56kd8.us.auth0.com ” ^/ ” ^http://localhost:4200 ” ^http://localhost:4200/ ” ^
 
             
            
              1 Like 
            
            
           
          
            
            
              I just realized that the data section does not have a very good representation of that payload for the token request.
             
            
              
            
           
          
            
            
              Figured out the problem.  I did not have the audience property in my auth object!   For future developers, you have to specify the APIs that you want to get tokens to authorize your user for.  In this case I am in an Angular web application, my auth details are in my environment.ts file and are passed to the AuthModule.forRoot() call in my app.module.ts.
Exerpt from app.module.ts
AuthModule.forRoot({https://localhost:8443/ *’
 
environment.ts
export const environment = {
 
             
            
              2 Likes 
            
                
            
           
          
            
            
              Hi @Blissitte ,
Thank you for your responses and for sharing your solution with the Community!
I’m glad that everything is working now.
Please don’t hesitate to reach out if you have any further questions.
Have a good rest of your day!
Thank you.
             
            
              1 Like 
            
            
           
          
            
              
                system  
              
                  
                    January 22, 2022, 11:17pm
                   
                  8 
               
             
            
              This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.