What it means
The OAuth2 authorization code was already redeemed. Retry with a new valid code, or use an existing refresh token.
Common causes
- The app tried to exchange the same authorization code more than once. Codes can be used only once.
- A retry, a double form submit, or a cached redirect sent the same code to the token endpoint again.
Quick checks
- Open Entra admin center → Entra ID → Monitoring & health → Sign-in logs, find the failed event, and copy the Correlation ID, date, and time.
- Read the Failure reason and Additional Details on that event. Additional Details often includes the next step.
- Check the Conditional Access tab to see which policies applied or blocked the sign-in, and the Authentication Details tab for the methods that ran and their results.
How to fix it
If you are the user
- Sign in again from the start. If the error persists, tell the app developer or your admin; this is almost always an app issue, not a problem with your account.
If you are an admin
- Ask the developer to request a new authorization code after this error, or to use a refresh token instead of exchanging the same code twice.
- Check for duplicate token requests in the app (retries, load-balanced redirects, or a page that is submitted twice).
When to escalate
Escalate if a correctly written app still redeems a code twice, or users are stuck in a redeem loop. Include the client ID, redirect URI, and the Correlation ID.
Official references
- Microsoft's AADSTS error code reference (opens in a new tab)
- Official lookup for AADSTS54005 (opens in a new tab)
Descriptions on this page are summarized from Microsoft’s official error reference and the troubleshooting articles linked above. Error wording can change; use the official lookup if something here does not match what you see.