Invalid response signing in via Microsoft identity provider with Azure AD B2C

Viewed 568

I'm creating an app that uses Azure AD B2C for identity handling, and I use MSAL for my Angular frontend to interact with it. Thus far I got local and Google accounts to work, but I'm having problems with getting a Microsoft identity provider to work with my app. In an attempt to do it I have been following the following guide: https://docs.microsoft.com/en-us/azure/active-directory-b2c/identity-provider-microsoft-account

Whenever I try to sign in via Microsoft account I get a following error:

ServerError: server_error: AADB2C90273: An invalid response was received : 'Error: invalid_request,Error Description: Proof Key for Code Exchange is required for cross-origin authorization code redemption.'

In my app settings I have 2 Redirect URIs configured:

For whatever reason only a combination of both seems to let me even get redirected back to my app after sign in, which is not the case with other identity providers. Yet the response it still an error.

Both client id and secret keys are configured correctly according to the instructions stated in the aforementioned MS guide doc.

Any help is appreciated.

1 Answers

So I did a little more digging, and it seems like adding a Web platform in addition to an original SPA platform, and putting the 2nd URI there resolves the problem. Although it seems more like a workaround to me.

Related