nextauthjs / nextauthjs/next-auth

[Azure AD B2C] OperationProcessingError: response is not a conform Authorization Server Metadata response in v5.0.0-beta.28

Open
#13,129 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug triage
Dominant language
TypeScript
Stars
28.4k
Forks
4k
PR merge metrics
No merged PRs in 30d

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 next-auth@4.24.11 as per the official documentation, and everything is working perfectly — I get the expected tokens and session.

However, after upgrading to next-auth@5.0.0-beta.28, I encountered the following error at runtime:

ERROR
[auth][error] OperationProcessingError: "response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)

Image

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction repository, its Azure configuration in .env.local, and the listed next-auth, @auth/core, Next.js, and React versions. Run npm run dev, reproduce the sign-in failure, and compare the metadata response with the expected redirect to Microsoft login and successful callback.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, node.js, react, typescript
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.