An API that connects multiple Microsoft services, enabling data access and automation across platforms
Yes, a token can appear to work for /me but fail with InvalidAuthenticationToken on mail endpoints when:
- The token is not actually valid for Microsoft Graph from the resource’s point of view (for example, wrong audience or issuer), or
- The resource that validates the token is different and performs stricter signature checks.
For Microsoft Graph, the error InvalidAuthenticationToken with message Signature is invalid indicates that Graph cannot validate the token’s signature. This is independent of the scopes such as Mail.Read; it means Graph treats the token itself as invalid, not merely under‑privileged.
From the provided details and the context, the most likely causes and checks are:
- Verify the audience (
aud) claim is for Microsoft Graph
Use a JWT decoder such ashttps://jwt.msto inspect the token and confirm thataudis one of the supported Microsoft Graph values:-
https://graph.microsoft.comorhttps://graph.microsoft.com/ - or the GUID
00000003-0000-0000-c000-000000000000
If theaudis for another API (for example, a custom API or Outlook REST), Graph will reject the token with a signature validation error even if some endpoints appear to work. Acquire the token with a Microsoft Graph scope such asMail.Readorhttps://graph.microsoft.com/.defaultso that theaudis set correctly.
-
- Confirm the issuer (
iss) and signing key (kid) are valid for the tenant
Still usinghttps://jwt.ms, check:-
issmatches the Microsoft Entra ID issuer for the tenant. -
kidcorresponds to a signing key that Graph can retrieve from the tenant’s OpenID configuration.
If the signing metadata is stale or misconfigured, Graph cannot validate the signature and returnsInvalidAuthenticationToken.
-
- Ensure the token is acquired for Microsoft Graph, not reused from another resource
The audience claim is determined by thescopeparameter when acquiring the token. For example, to get a token for a custom APIhttps://api.contoso.com, the scope must be likehttps://api.contoso.com/read. A token acquired for such a scope cannot be reused against Microsoft Graph; Graph will fail signature validation. Acquire a fresh token specifically for Microsoft Graph using the proper scopes. - Do not rely on inspecting or reusing access tokens across components
Application code should not attempt to decode or repurpose access tokens. Tokens might be encrypted or change format, and reusing them for different resources can lead to exactly these signature validation issues. Instead, each component should acquire its own token for the resource it calls, using a library such as MSAL. - Distinguish between token validity and permissions
- If the token is invalid (wrong audience, issuer, or signature), Graph returns
401withInvalidAuthenticationTokenandSignature is invalid. - If the token is valid but lacks mail permissions, Graph returns
403with a permissions-related error.
In this case, the presence of mail scopes inscpis not relevant until the token’s signature is accepted.
- If the token is invalid (wrong audience, issuer, or signature), Graph returns
- Mailbox or account state does not cause
Signature is invalid
Issues such as no mailbox, disabled mailbox, or personal vs. work account typically result in different error codes (for example,ErrorMailboxNotFoundorOrganizationFromTenantGuidNotFound). They do not cause a signature validation failure. The error here points specifically to token acquisition or configuration, not Exchange mailbox availability.
Recommended resolution steps:
- Decode the failing token with
https://jwt.ms. - Confirm
audis one of the Microsoft Graph values listed above. - Confirm
issmatches the tenant’s issuer and that the token is issued by Microsoft Entra ID for that tenant. - Acquire a new access token for Microsoft Graph using MSAL and a Graph scope (
Mail.Read,Mail.ReadWrite, etc.), then call/me/mailFoldersand/me/messageswith that token in theAuthorization: Bearer <token>header. - If the error persists even with a freshly acquired Graph token, investigate tenant authorization server metadata (for example, if using on‑premises components or custom auth servers) and refresh or correct the configuration so that Graph can retrieve the correct signing keys.
References: