QuestionAccepted answer
AADSTS9002325: Proof Key for Code Exchange is required for cross-origin authorization code redemption
user14504804
26 May 2025, 17:02 UTC
83.2K views1
I created a spa application owned by my organization only, but there was a problem when I requested code. How can I resolve it?
1 answer
Accepted answer · original discussion
Carl Zhao
Permalink29 May 2025, 17:02 UTC
I can reproduce your problem, you have to add the redirect URL under the web (not single page application). After that, you will be able to use the auth code flow to get the code.
2 question comments
Use comments to ask for clarification. Post a solution as an answer.
Carl ZhaoPermalink
28 May 2025, 05:02 UTC
Try to change the platform configuration from
SPA to Web. What is the result?w. Patrick GalePermalink
31 May 2025, 05:02 UTC
This likely depends heavily on the type of application architecture you are using (not mentioned in the question). I received this error as well trying to use the AzureADProvider in Next-Auth (v4) for a NextJs app (standard NextJs server config - not custom server) with Azure configuration set to the SPA platform. However when I switched to using
@azure/msal-browser and @azure/msal-react I had to switch my Azure app platform back to SPA for the authentication to succeed.