Provider type
Azure Active Directory
Environment
System:
OS: Windows 10 10.0.19045
CPU: (8) x64 Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz
Memory: 794.18 MB / 7.84 GB
Binaries:
Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
npm: 8.5.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 110.0.5481.104
Edge: Spartan (44.19041.1266.0), Chromium (110.0.1587.50)
Internet Explorer: 11.0.19041.1566
npmPackages:
next: 12.2.4 => 12.2.4
next-auth: ^4.10.3 => 4.10.3
react: "^18.2.0"=> 18.0.17
Reproduction URL
private
Describe the issue
We have implemented two providers Email link and Azure Active Directory. Adapter is Prisma and db PostgreSQL.
The Email link is working ok.
Azure-ad provider is failing when trying to signIn with a user that has previously signed in using email link. The URI is redirected with error=OAuthAccountNotLinked.
Debug mode shows:
- Azure-ad returning ok result
- Adapter calling
adapter_getUserByAccount and adapter_getUserByEmail and the process stops with error=OAuthAccountNotLinked redirection.
How to reproduce
- Sign in with a user via magic link -> user record will be generated in db
- Sign out
- Sign in the same user(email) via azure-ad
Expected behavior
Azure-ad sign-in should be compatible with email link mechanism as stated here:
https://next-auth.js.org/faq#when-i-sign-in-with-another-account-with-the-same-email-address-why-are-accounts-not-linked-automatically
Provider type
Azure Active Directory
Environment
System:
OS: Windows 10 10.0.19045
CPU: (8) x64 Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz
Memory: 794.18 MB / 7.84 GB
Binaries:
Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
npm: 8.5.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 110.0.5481.104
Edge: Spartan (44.19041.1266.0), Chromium (110.0.1587.50)
Internet Explorer: 11.0.19041.1566
npmPackages:
next: 12.2.4 => 12.2.4
next-auth: ^4.10.3 => 4.10.3
react: "^18.2.0"=> 18.0.17
Reproduction URL
private
Describe the issue
We have implemented two providers Email link and Azure Active Directory. Adapter is Prisma and db PostgreSQL.
The Email link is working ok.
Azure-ad provider is failing when trying to signIn with a user that has previously signed in using email link. The URI is redirected with error=OAuthAccountNotLinked.
Debug mode shows:
adapter_getUserByAccountandadapter_getUserByEmailand the process stops with error=OAuthAccountNotLinked redirection.How to reproduce
Expected behavior
Azure-ad sign-in should be compatible with email link mechanism as stated here:
https://next-auth.js.org/faq#when-i-sign-in-with-another-account-with-the-same-email-address-why-are-accounts-not-linked-automatically