Replies: 4 comments 1 reply
-
Folks, I'm a customer experience PM from the Microsoft Entra team (formerly Azure AD) and would like to continue this discussion. I have discussed internally with my colleagues at Microsoft and would like to propose the following. Microsoft currently has three offerings:
Our proposal is
Thoughts? @balazsorban44 @ThangHuuVu @andrem0 |
Beta Was this translation helpful? Give feedback.
-
The current v4 azure-ad provider needed the small change as described above to get it working with Entra External Id. I think renaming the azure-ad provider is a welcome idea (as well as writing the documentation for easier adoption), when keeping in mind that anyone currently running v5 in production and passing the issuer with prepended Also I'm not entirely sure that #9718 will not break the provider for the Entra External Id use case. Whatever the case, if this here gets turned into an issue I'd be happy to pick it up, make the required changes and add documentation to both maintained branches. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/vesas/authjs-base looks like an example? |
Beta Was this translation helpful? Give feedback.
-
Microsoft Entra ID External (Tested on Microsoft Entra ID v2 and Next-Auth v5.0.0-beta.20)I have successfully set up Microsoft Entra ID External using Next-Auth. Background on Microsoft Azure AD / Microsoft Entra ID with Next-AuthConfiguring Microsoft Azure AD / Microsoft Entra ID can be challenging because Microsoft does not fully adhere to OAuth2 standards and best practices. Next-Auth, at the moment, is not willing to customize specifically for Microsoft. In this case, I agree with Next-Auth; Microsoft should comply with standards. This non-compliance results in a poor developer and integration experience. Microsoft OfferingsMicrosoft currently has three offerings:
Next-Auth ProvidersAs of Next-Auth v5.0.0-beta.20, three providers are offered:
I suggest using Microsoft Entra ID and ignoring the other providers. Callback
Environment VariablesNote that the environment variables below are based on Next.js. The $ symbol is used to concatenate the variables within the environment file. In Next.js development, this is done in the .env.local file.
Microsoft Entra ID external environment variablesHere is a guideline on how to get the proper Microsoft Entra ID external resources: Visit entra.microsoft.com.
Microsoft Entra ID External scopesNext-Auth configuration
DONT WASTE YOUR TIMENOTE: The issuer as of next-auth v5 v5.0.0-beta.20 is configurable; please include it directly as highlighted above. The issuer needs to be copied exactly as it is. Failure to do so will result in next-auth throwing an invalid issuer error when the callback URL is run, which can be persistently annoying and difficult to spot. NOTE: The wellKnown option is not configurable; therefore, you must set the token and userinfo endpoints. Failure to do so will result in next-auth checking against incorrect token and userinfo endpoints when the callback URL is run. |
Beta Was this translation helpful? Give feedback.
-
Goals
Non-Goals
No response
Background
Current Azure Active Directory and Azure Active Directory B2C does not work out of the box with Microsoft Entra ID and Microsoft Entra ID for customers.
Proposal
Modify the current implementations of AD, and create new providers for both Entra variants.
Beta Was this translation helpful? Give feedback.
All reactions