Tips

Understanding Microsoft Access Token Validation

Summary

In many OAuth2/OpenID Connect workflows with Azure, access tokens are issued to clients for use against specific resources. This document summarizes the rationale behind token validation, when it is appropriate to perform it, and how different Microsoft services handle it.

Token Ownership: Who Should Validate?

According to Microsoft’s official documentation (source):

“An access token request involves two parties: the client, who requests the token, and the resource (Web API) that accepts the token. The resource that the token is intended for (its audience) is defined in the aud claim in a token. Clients use the token but shouldn’t understand or attempt to parse it. Resources accept the token.”

Conclusion:

Why Azure Management (AZ) Tokens Can Be Validated

Azure Management (e.g., https://management.azure.com) is a resource, just like Microsoft Graph. However:

Use Cases Where AZ Token Validation Makes Sense

How Microsoft Graph (MG) Validates Tokens Internally

When a request is made to MS Graph with a bearer token:

  1. The token is extracted from the Authorization header.
  2. MS Graph uses its internal trust system (backed by Azure AD) to:
    • Fetch signing keys (from Azure AD JWKS).
    • Verify the token’s cryptographic signature.
    • Confirm claims like aud, iss, exp, nbf, etc.

Why You Shouldn’t Validate MG Tokens Yourself

Final Thoughts

Treat tokens as bearer credentials, not application-owned data.