Also for webapi, in azure ad you need to define a scope and api access for azure ad application. The client request for access token should include this scope.
www-authenticate: Bearer error="invalid_token",error_description="The signature is invalid"
Hi,
I am trying to use my ad token at web api and getting following error
www-authenticate: Bearer error="invalid_token",error_description="The signature is invalid"
![]()
I have added below configurations to my appsettings.json
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"ClientId": "810c70dc-df08-4172-93ac-XXXXXX",
"TenantId": "7d6b867e-d1c6-4378-8c59-XXXXXXX"
}
and below authentication scheme to my program.cs
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApi(builder.Configuration.GetSection("AzureAd"));
Kindly guide how to resolve this issue.
Developer technologies ASP.NET ASP.NET Core
Microsoft Security Microsoft Entra Microsoft Entra ID
2 answers
Sort by: Most helpful
-
Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
2022-10-08T16:44:12.803+00:00 -
Vinodh247 34,661 Reputation points MVP Volunteer Moderator
2022-10-08T10:02:12.633+00:00 Hi
Thanks for reaching out to Microsoft Q&A.
These are accepted answers for the same error earlier, please check -one of these should work for you.
https://stackoverflow.com/questions/48944697/bearer-error-invalid-token-error-description-the-signature-is-invalid
https://learn.microsoft.com/en-us/answers/questions/762957/www-authenticate-bearer-error34invalid-token34-err.htmlPlease Upvote and Accept as answer if the reply was helpful, this will be helpful to other community members.