question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] WWW-Authenticate: Bearer error="invalid_token", error_description="The signature is invalid"

See original GitHub issue

Which version of Microsoft Identity Web are you using? 1.8.2

Where is the issue?

  • Web API
    • Protected web APIs (validating tokens)

Is this a new or an existing app? c. This is a new app or an experiment.

Repro My reference is the following sample application provided by Microsoft. To generate the token. Then pass the token as a ‘Bearer’

microsoft-authentication-library-for-js\samples\msal-react-samples\typescript-sample

[(https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-react-samples/typescript-sample)]

In my WebAPI I have registered the following middleware with the following configuration fields.

services.AddMicrosoftIdentityWebApiAuthentication(Configuration);

"AzureAd": { "Instance": "https://login.microsoftonline.com/", "ClientId": "client_id_as_it_appear_in_azure_portal", "TenantId": "tenant_id_as_it_appear_in_azure_portal", "AllowWebApiToBeAuthorizedByACL": true }

Expected behavior Expecting the validate the token and allow users to consume procted resources

Actual behavior Following error with 401 https status

WWW-Authenticate: Bearer error="invalid_token", error_description="The signature is invalid"

Possible solution

Additional context / logs / screenshots image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
senalcommented, Apr 5, 2021

I was able to fix my issue with by following the above tutorial and the provided technical guidance.

0reactions
senalcommented, Apr 5, 2021

Was able to get it working.

Thanks @jmprieur for your advices right directions. @derisen , big thanks to your advices and support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bearer error="invalid_token", error_description="The ...
The error is: Microsoft.IdentityModel.Tokens.SecurityTokenInvalidSignatureException: 'IDX10500: Signature validation failed. No security keys ...
Read more >
Bearer error="invalid_token",error_description="The ...
Hi,. I am trying to use my ad token at web api and getting following error. www-authenticate: Bearer error="invalid_token" ...
Read more >
www-authenticate: Bearer error="invalid_token" ...
I need to use that access token as a bearer token to secure… ... Bearer error="invalid_token", error_description="The signature is invalid" ...
Read more >
401, Bearer error="invalid_token", The audience is invalid
Hello, I am developing a web application using asp .net core and React with auth0. So far, I've had no issues with setting...
Read more >
.net core API error of "Invalid token" for second Auth0 ...
net API fails with an invalid token error ( WWW-Authenticate: Bearer error=“invalid_token”, error_description=“The signature key was not found”) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found