authorize AzureAD access_token in .net 6 webapi getting invalid token signature

srinivas kolagani 1 Reputation point

I have added my angular application into azureAD and trying to get access_token and passing that token to webapi but getting unauthorized error. I have tried multiple ways. I am just accessing basic weatherforecast controller with authorize attribute

    .AddJwtBearer(options =>  
        options.Authority = "{tenant-id}";  
        options.Audience = "api://{client-id}";  

  .AddMicrosoftIdentityWebApi(options =>  
      builder.Configuration.Bind("AzureAd", options);  
      options.Events = new JwtBearerEvents();  


}, options => { builder.Configuration.Bind("AzureAd", options); });


Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
12,642 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce ( 28,036 Reputation points

    In ad, under the application add api permissions

    Be sure to include the scope defined with the permissions defined above in the angular msal login.