nextauthjs / nextauthjs/next-auth

GitHub OAuth provider no longer works. Was there some recent change by GitHub?

Open
#13,409 4 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Provider type

GitHub

Environment
  System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Xeon(R) CPU E31245 @ 3.30GHz
    Memory: 4.06 GB / 15.96 GB
  Binaries:
    Node: 22.17.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Users\me\AppData\Roaming\npm\yarn.CMD
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
    bun: 1.2.18 - C:\Users\me\AppData\Roaming\npm\bun.CMD
  Browsers:
    Edge: Chromium (140.0.3485.54)
    Firefox: 149.0.2 - C:\Program Files\Mozilla Firefox\firefox.exe
    Firefox Developer Edition: 150.0 - C:\Program Files\Firefox Developer Edition\firefox.exe
    Internet Explorer: 11.0.19041.5794
Reproduction URL

https://github.com/dataspecer/dataspecer/tree/git-integration

Describe the issue

The issue is that when I try to sign-in using GitHub I get an server error seen below. Both when using my application and the official deployed example. I am 100% sure that my application worked a month ago and almost 100% sure that it did work 4 days ago. I also tried going back to older commits with the same result. Therefore, the issue should not be caused by me.

The sign-in results in the following image:

Image

When running locally with debug option on I get the following error:

[auth][debug]: callback route error details {
  "method": "GET",
  "query": {
    "code": "xxxxxxxxxxxxxe0b2b",
    "iss": "https://github.com/login/oauth"
  }
}
[auth][error] CallbackRouteError: Read more at https://errors.authjs.dev#callbackrouteerror
[auth][cause]: OperationProcessingError: unexpected "iss" (issuer) response parameter value
    at OPE (C:\Users\me\my-oauth\node_modules\oauth4webapi\src\index.ts:1044:10)
    at Module.validateAuthResponse (C:\Users\me\my-oauth\node_modules\oauth4webapi\src\index.ts:5586:11)
    at handleOAuth (file:///C:/Users/me/my-oauth/node_modules/@auth/core/lib/actions/callback/oauth/callback.js:93:29)
    at async Module.callback (file:///C:/Users/me/my-oauth/node_modules/@auth/core/lib/actions/callback/index.js:37:41)
    at async AuthInternal (file:///C:/Users/me/my-oauth/node_modules/@auth/core/lib/index.js:29:24)
    at async Auth (file:///C:/Users/me/my-oauth/node_modules/@auth/core/index.js:111:34)
    at async file:///C:/Users/me/my-oauth/node_modules/@auth/express/index.js:151:45
[auth][details]: {
  "expected": "https://authjs.dev",
  "parameters": {},
  "provider": "github"
}
How to reproduce

Try signing in to the example URL using GitHub.

Expected behavior

I should be signed in with no issues. Any quick help would be greatly appreciated, since I have a project deadline in a couple of days.

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

Reproduce the failure at the linked example URL, then start with the callback trace in @auth/core/lib/actions/callback/oauth/callback.js and oauth4webapi's validateAuthResponse. Compare the returned GitHub issuer with the expected value shown in the debug details. Done means GitHub sign-in completes without the issuer or callback error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.