-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
Environment
System:
- OS: Windows 11 Pro
Binaries:
- Node: 20.17.0
- npm: 10.8.2
- pnpm: 10.12.4
Browsers:
- Chrome: 138.0.7204.158
npm packages:
- "@auth/core": "^0.40.0",
- "next": "15.4.3",
- "next-auth": "^5.0.0-beta.28",
- "react": "19.1.0",
- "react-dom": "19.1.0"
Reproduction URL
https://github.com/DharmiVekariya/NextjsAzureADB2C
Describe the issue
Hi team,
I have implemented Azure AD B2C authentication flow using [email protected] as per the official documentation, and everything is working perfectly — I get the expected tokens and session.
However, after upgrading to [email protected], I encountered the following error at runtime:
ERROR
[auth][error] OperationProcessingError: "response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)

Unfortunately, the error message is unclear, and I'm not sure what the actual cause is. It breaks during authentication. All environment variables are set correctly.
Please let me know if I’m missing any required changes for v5 beta compatibility with Azure AD B2C.
How to reproduce
To reproduce
- Add Azure Configuration in
.env.local
file - Run application with
npm run dev
- Open
http://localhost:3000/
in a browser - Click on SignIn button and it will show the error in terminal
Expected behavior
The expected behavior is that the user should be redirected to the Microsoft login screen, and after a successful login, redirected back to the application.