Closed
Description
What is the improvement or update you wish to see?
Hi,
Documentation for the Entra ID provider in the Setup -> Configuration -> NextJS section seems incorrect:
import NextAuth from "next-auth"
import MicrosoftEntraID from "next-auth/providers/microsoft-entra-id"
const { handlers, auth, signIn, signOut } = NextAuth({
providers: [
MicrosoftEntraID({
clientId: process.env.AUTH_MICROSOFT_ENTRA_ID_ID,
clientSecret: process.env.AUTH_MICROSOFT_ENTRA_ID_SECRET,
issuer: process.env.AUTH_MICROSOFT_ENTRA_ID_ISSUER,
}),
],
})
Should read:
import NextAuth from "next-auth"
import MicrosoftEntraID from "next-auth/providers/microsoft-entra-id"
const { handlers, auth, signIn, signOut } = NextAuth({
providers: [
MicrosoftEntraID({
clientId: process.env.AUTH_MICROSOFT_ENTRA_ID_ID,
clientSecret: process.env.AUTH_MICROSOFT_ENTRA_ID_SECRET,
issuer: `https://login.microsoftonline.com/${process.env.AUTH_MICROSOFT_ENTRA_ID_ISSUER}/v2.0`,
}),
],
})
Is there any context that might help us understand?
From the below it looks like the provider is expecting a URL in the issuer
field.
See https://github.com/nextauthjs/next-auth/blob/main/packages/core/src/providers/microsoft-entra-id.ts
Line 108
config.issuer ??= "https://login.microsoftonline.com/common/v2.0"
Does the docs page already exist? Please link to it.
https://authjs.dev/getting-started/providers/microsoft-entra-id