The signature key was not found, Bearer error="invalid_token", error_description="The audience is invalid"

SATISH KHASHABA JADHAV 0 Reputation points
2023-12-12T15:15:24.52+00:00

My SPA application is registered in Azure. I use MSAL for user authentication and call secured API, however I get below error while calling the API

Bearer error="invalid_token", error_description="The signature key was not found"
Bearer error="invalid_token", error_description="The audience is invalid"

I pass application client id to class PublicClientApplication of @azure/msal-browser library and gets a ID Token which is passed while calling the API.

It works fine when I use another application client id. Hence, I compared both apps setting registered in Azure and they are exactly same.

Can you please suggest what could be missing?

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,426 Reputation points
    2023-12-13T06:09:43.67+00:00

    Hi @SATISH KHASHABA JADHAV

    You should pass access token instead of id token when calling web API.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.