MSAL-React B2C -> getting AADSTS9002325: Proof Key for Code Exchange is required....

Tim Anderson 20 Reputation points
2025-02-14T17:59:09.95+00:00

We are now getting this error:
Sorry, but we’re having trouble signing you in.

AADSTS9002325: Proof Key for Code Exchange is required for cross-origin authorization code redemption.

Troubleshooting details

If you contact your administrator, send this info to them.

Copy info to clipboard

Request Id: 93cbd5ae-214f-4dd3-8938-6e81335f0e00

Correlation Id: 7611fad9-3460-4225-bde7-12f1aff6f7a5

Timestamp: 2025-02-14T17:55:19Z

Message: AADSTS9002325: Proof Key for Code Exchange is required for cross-origin authorization code redemption.

Flag sign-in errors for review: Enable flagging

If you plan on getting help for this problem, enable flagging and try to reproduce the error within 20 minutes. Flagged events make diagnostics available and are raised to admin attention.

I've seen that it's related to redirect URL, and we do have the correct URL in our Application:
User's image

Here's the redirectURL passed in the config object:

redirectUri: 'http://localhost:3000/'

Not sure what else to try to fix this....

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,255 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Akhilesh Vallamkonda 11,755 Reputation points Microsoft Vendor
    2025-02-14T21:11:31.8433333+00:00

    Hi @Tim Anderson
    Thank you for reaching Microsoft Q&A Forum!
    The Entra ID error AADSTS9002325 may occur when you change your Entra ID app registration's redirect URL to a Single Page Application (SPA). from the Screen shot I can see you have used Single Page Application. changed the registered app to Web and see if the issue is fixed. User's image

    Reference: Configure platform settings
    Hope this helps. Do let us know if you any further queries by responding in the comments section.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.