Support for Multi-Domain NextAuth Configuration in Single App Service Deployment (Azure AD) #13118
Unanswered
iris-debiprasad
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi NextAuth team 👋,
We’re encountering a problem while using NextAuth.js with Azure AD provider in a multi-domain setup on a single Next.js app service deployment.
Context
Framework: Next.js
Auth Provider: Microsoft Azure AD
Auth Library: NextAuth.js
Deployment: Single App Service (e.g., Azure App Service)
Domains:
Both domains point to the same deployed Next.js app. We use NextAuth.js for authentication with Azure AD, which requires setting the NEXTAUTH_URL environment variable to generate the proper redirect URI (i.e., https:///api/auth/callback/azure-ad).
The Problem
Since there is only one environment per app service, we can only set a single NEXTAUTH_URL, which causes issues when:
What We Tried
Works partially but is not safe for concurrent users.
Leads to interference between user sessions from different domains.
What We’re Looking For
Beta Was this translation helpful? Give feedback.
All reactions