How to fix 'AADSTS9002325: Proof Key for Code Exchange is required for cross-origin authorization code redemption' error in MSAL Angular Application

MMans 0 Reputation points
2025-02-04T21:17:15.5733333+00:00

I'm deploying an angular app to azure using MSAL Angular for authentication. Much like the user in this post doing a similar thing with a nextjs app (https://learn.microsoft.com/en-us/answers/questions/1194524/how-to-fix-aadsts9002325-proof-key-for-code-exchan), The app works fine when I host it locally and use localhost as the redirect uri; however, when I deploy the app to Azure, I always get the error "AADSTS9002325: Proof Key for Code Exchange is required for cross-origin authorization code redemption." after signing in.

Angular version is 17.0.4 and MSAL version is 3.1.0

I am using single tenant, multitenant or Azure AD B2C, since I only want users who are part of my organization to be able to log in.
As for troubleshooting steps I've already tried, I've tried changing the platform to web instead of SPA, since it was recommended by a lot of people in different forums, which didn't work for me. I also already made sure that the Azure AD App registration and the auth config in the app itself both have the same redirect URI.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,255 questions
{count} votes

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.