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

MicrosoftEntraID docs in 5.0 misleading #12193

Closed
rhufsky opened this issue Nov 6, 2024 · 2 comments
Closed

MicrosoftEntraID docs in 5.0 misleading #12193

rhufsky opened this issue Nov 6, 2024 · 2 comments
Labels
triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@rhufsky
Copy link
Contributor

rhufsky commented Nov 6, 2024

What is the improvement or update you wish to see?

The docs recommend this config

import MicrosoftEntraID from "@auth/core/providers/microsoft-entra-id"
 
providers: [
  MicrosoftEntraID({
    clientId: env.AUTH_MICROSOFT_ENTRA_ID_ID,
    clientSecret: env.AUTH_MICROSOFT_ENTRA_ID_SECRET,
    issuer: env.AUTH_MICROSOFT_ENTRA_ID_TENANT_ID,
  }),
]

Change issuerto tenantId.

Is there any context that might help us understand?

The docs recommend this config

import MicrosoftEntraID from "@auth/core/providers/microsoft-entra-id"
 
providers: [
  MicrosoftEntraID({
    clientId: env.AUTH_MICROSOFT_ENTRA_ID_ID,
    clientSecret: env.AUTH_MICROSOFT_ENTRA_ID_SECRET,
    issuer: env.AUTH_MICROSOFT_ENTRA_ID_TENANT_ID,
  }),
]

internally issuer seems to be an URL. When providing tenant id here, the provider raises an exception while attempting to create an URL object out of the tenant id.

Does the docs page already exist? Please link to it.

https://authjs.dev/reference/core/providers/microsoft-entra-id

@rhufsky rhufsky added the triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. label Nov 6, 2024
@Riyooo
Copy link

Riyooo commented Nov 7, 2024

I also had trouble following the documentation and migrating to the new Microsoft Entra ID provider, thinking that the 'issuer' parameter was the 'tenantId', which caused the following error:
[auth][error] TypeError: Invalid URL

'issuer' seems instead to be an URL in the following format: https://login.microsoftonline.com/[tenantID]/v2.0
So finally what I did was changing my .env.local file and adding the following entry which seems to work:

# the issuer URL
AUTH_MICROSOFT_ENTRA_ID_ISSUER="https://login.microsoftonline.com/$AUTH_MICROSOFT_ENTRA_ID_TENANT_ID/v2.0"

Maybe could the docs be more specific about this parameter?

@rhufsky
Copy link
Contributor Author

rhufsky commented Nov 8, 2024

You are right, this works, see also #12195

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