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.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
options.Authority = "https://login.microsoftonline.com/{tenant-id}";
options.Audience = "api://{client-id}";
});
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApi(options =>
{
builder.Configuration.Bind("AzureAd", options);
options.Events = new JwtBearerEvents();
}, options => { builder.Configuration.Bind("AzureAd", options); });
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.