unable to find the kid in the list of keys to validate the id token

Rahul Sadaphal 40 Reputation points
2023-01-24T07:06:42.7833333+00:00

I am getting id token once i click on the user flow in azure ad b2c.

Now i simply need to validate that id token using the kid from the token header

But I cannot find key ids in discovery/keys url which matches with the kid of token header. I have tried below url to fetch the keys list

https://login.microsoftonline.com/{tenant_id}/discovery/v2.0/keys

https://login.microsoftonline.com/common/discovery/v2.0/keys

I am getting below kid from the token - X5eXk4xyojNFum1kl2Ytv8dlNP4-c57dO6QGTVBwaNk

This key id is not available in the list of keys.

I will really appreciate if someone helps me with this, as I am stuck on such a minor issue.

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,955 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,523 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Imran Momin 0 Reputation points
    2024-05-21T17:57:15.5133333+00:00

    I'm also facing the same issue.

    The token is returned back with kid : xoQ0V3SJHAnA-QOShOVf40-VpxA

    0 comments No comments

  2. Kuldeep Saxena 0 Reputation points
    2024-06-03T22:17:21.18+00:00

    you can find the kid via

    https://login.microsoftonline.com/{tenant_id}/discovery/v2.0/keys?appid={application app id}

    0 comments No comments

Your answer

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