Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider Documentation: Micosoft Entra ID #12314

Open
Br4v3St4rr opened this issue Nov 28, 2024 · 1 comment
Open

Provider Documentation: Micosoft Entra ID #12314

Br4v3St4rr opened this issue Nov 28, 2024 · 1 comment
Labels
triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@Br4v3St4rr
Copy link

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

@Br4v3St4rr Br4v3St4rr added the triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. label Nov 28, 2024
@graemen16
Copy link

Thanks - I got an error about url format when I changed the Entra definition following update from beta 22 to beta 25. Changing to the url definition resolved the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

2 participants