Azure AD: Validate access_token

adusheba 21 Reputation points

I used endpoing '{tenantId}/oauth2/v2.0/token' to obtain access_token,
Now, i want to validate that access_token, in my application, using public key obtained in ''

However every soulution that i found for this didn't work for me. (e.g.

Does anyone know if it's possible to accomplish such validation?

p.s. i also found such info in microsoft article, saying it's not possible to validate such token, maybe that the reason (


Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
17,604 questions
0 comments No comments
{count} votes

Accepted answer
  1. Shweta Mathur 22,956 Reputation points Microsoft Employee

    Hi adusheba-9169,

    Thanks for reaching out.

    I understand you are looking to verify the signature of the access token issued by Azure Ad by using public endpoint.

    An access token contains claims that you can use in Azure Active Directory to identify the granted permissions to your APIs. When your internal application receives an access token, it must validate the signature to prove that the token is authentic.

    To Verify the JWT token:

    Verify that the JWT contains three segments, separated by two period ('.') characters.

    Parse the JWT to extract its three components. The first segment is the Header, the second is the Payload, and the third is the Signature. Each segment is base64url encoded.

    Signature contains the digital signature of the token that was generated by Azure AD’s private key and verify that the token was signed by the sender.

    To validate the authenticity of the JWT token’s data is by using Azure AD’s public key to verify the signature.

    You can obtain public key by calling the public Azure AD OpenID configuration endpoint:{tenant_id}/discovery/keys?appid={client_id} and verify against the private key generated by Azure AD token. For validation, developers can decode JWTs using and verify against "kid" claim.

    If it works, you know the contents were signed with the private key. If not, you can’t be sure of it so you should treat the JWT token as an invalid token.

    The warning which is mentioned is regarding that access token are secure and contain sensitive information so we should avoid reading other's tokens and secure our tokens securely from attacks.

    Hope this will help.



    Please remember to "Accept Answer" if answer helped you.

1 additional answer

Sort by: Most helpful
  1. Juan Carrilho 26 Reputation points

    I was able to validate an access token issued by Azure AD for a user following this tutorial

    1 person found this answer helpful.
    0 comments No comments