AADSTS90056
BadResourceRequest
What Microsoft says
To redeem the code for an access token, the app should send a POST request to the /token endpoint. Also, prior to this, you should provide an authorization code and send it in the POST request to the /token endpoint. Refer to this article for an overview of OAuth 2.0 authorization code flow. Direct the user to the /authorize endpoint, which will return an authorization_code. By posting a request to the /token endpoint, the user gets the access token. Check App registrations > Endpoints to confirm that the two endpoints were configured correctly.
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.