Replies: 1 comment 1 reply
-
I've implemented the azure-ad-b2c login and did not face this issue, I think you might be doing something wrong. Could you share your code? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Your question
I'm trying to use Azure B2C Authorization Code flow with OAuth 2.0 and i got the access token / id token v2.0. After that NextAuth tries to use this access token v2.0 against the Graph endpoint at : https://graph.microsoft.com/oidc/userinfo in order to fetch the user profile.
The problem is that this endpoint expect to see a claim called 'x5t' in the token, which is only available in v1.0. In v2.0 tokens there is no x5t claim, so the request fails and NextAuth returns with an error.
I can't skip this step to fetch the user profile. If i remove the profileUrl from the Provider configurations , NextAuth will just return an INVALID ARG error.
I know that this seems to be a problem from Microsoft itself, but how can i skip this profile fetching step from NextAuth, so that the error doesn't occur?
This part of the code from NextAuth that fetch the user profile:
What are you trying to do
I'm trying to authenticate with Azure B2C using Authorization Code flow with OAuth 2.0
Reproduction
Feedback
Documentation refers to searching through online documentation, code comments and issue history. The example project refers to next-auth-example.
Beta Was this translation helpful? Give feedback.
All reactions