Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BattleNet Provider not working (400 The state parameter must be provided) #12869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RimuruOtter opened this issue Apr 13, 2025 · 2 comments
Closed
Labels
bug Something isn't working providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@RimuruOtter
Copy link

Provider type

Battlenet

Environment

  System:
    OS: Windows 11 10.0.26100
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 16.41 GB / 31.90 GB
  Binaries:
    Node: 22.13.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
    bun: 1.2.0 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (131.0.2903.112)
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    next: 15.3.0 => 15.3.0
    next-auth: ^5.0.0-beta.25 => 5.0.0-beta.25
    react: ^19.0.0 => 19.1.0

Reproduction URL

https://github.com/RimuruOtter/authtest

Describe the issue

The issue is that when a user tries to log into their BattleNet account, it stops them and states "400 The state parameter must be provided". I tried just setting state="none" but when the request went thru, it threw an error about the "nonce".

How to reproduce

Create a bare bones next auth project with the BattleNet provider. Then attempt to sign in.

Expected behavior

Should instead of requesting the state parameter, allow the user to log into their account.

@RimuruOtter RimuruOtter added bug Something isn't working providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Apr 13, 2025
@JoshApp
Copy link

JoshApp commented Apr 13, 2025

try adding

checks: ['nonce'],

mine is setup like this

BattleNetProvider({ clientId: process.env.BATTLENET_CLIENT_ID, clientSecret: process.env.BATTLENET_CLIENT_SECRET, issuer: "https://us.battle.net/oauth", checks: ['nonce'], // idToken: true, }),

@RimuruOtter
Copy link
Author

Worked like a charm, thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

2 participants