AADSTS500133
What Microsoft says
Assertion isn't within its valid time range. Ensure that the access token isn't expired before using it for user assertion, or request a new token. Current time: {curTime}, expiry time of assertion {expTime}. Assertion is invalid because of various reasons: The token issuer doesn't match the API version within its valid time range; Expired; Malformed; Refresh token in the assertion isn't a primary refresh token
How to fix it
Microsoft doesn't publish a specific fix for this code beyond the description above. This site groups it under app registration and tokens, based on that description, so start with the steps below.
How to investigate
- Compare what the app sends (client ID, redirect URI, scopes, tenant) with the app registration.
- Decode the token or request: the JWT and SAML decoders on this site show exactly what was sent.
- Check the app's credentials (secrets and certificates) and whether the service principal exists and is enabled in this tenant.
- Search the sign-in logs for the request ID or correlation ID from the troubleshooting details on the error page.
Tools that help
The description is quoted from Microsoft's error code reference. The grouping and investigation steps are this site's guidance.