OAuth: Client IDs not recognized at oauth.battlenet.com.cn

Hello,

We have an old OAuth integration and have recently migrated over to oauth.battlenet.com / oauth.battlenet.com.cn respectively. On the Global side everything is working fine, but on the CN side we’re getting “401 - Bad client credentials” when accessing the authorize URL. That is to say:

  • https://oauth.battle.net/authorize?client_id=<our_client_id>&redirect_uri=<...> works as expected
  • https://oauth.battlenet.com.cn/authorize?client_id=<our_client_id>&redirect_uri=<...> fails with a 401

Interestingly enough the URLs also behave differently when omitting the redirect_uri: the global /authorize endpoint responds with “400 - The redirect_uri parameter must be a valid URI”, and the CN version responds with the same “401 - Bad client credentials”. I can get the global endpoint to also respond with a 401 if I choose an invalid client id.

This makes me believe that oauth.battlenet.com.cn does not recognize client ids registered in the developer portal. Do we need to recognize a Chinese Client ID somewhere else than the developer portal? Is this a bug?

We’re hoping on a quick resolution as we’ve got a huge set of Hearthstone players trying to log in to our site, after the Hearthstone re-release in China this week.

As of May 5, 2025, this issue still persists. Additionally, https://oauth.battlenet.com.cn/token doesn’t work either (same 401 error). Has anyone found a solution?

An anonymous NetEase employee clarified that the entire web API system in the CN region is not intended for production use and is strictly limited to internal use only, for now. Interesting. :frowning_face:

Current documentation for Oauth for CN is as follows the urls should be

www.battlenet.com.cn/oauth/authorize
www.battlenet.com.cn/oauth/token

try these and you should get a better result

Current documentation for Oauth for CN is as follows the urls should be

www.battlenet.com.cn/oauth/authorize
www.battlenet.com.cn/oauth/token

try these and you should get a better result

No, those URLs are severely outdated (and haven’t worked for many years). The “Using OAuth” documentation at (https://develop.battle.net/documentation/guides/using-oauth) states https://oauth.battlenet.com.cn/authorize. This changed back in late 2018 when the URLs migrated:

  • https://<region>.battle.net/oauth/https://oauth.battle.net/
  • https://www.battlenet.com.cn/oauth/https://oauth.battlenet.com.cn/)

I’d link to the dev portal announcement, but Blizzard hasn’t kept the migration announcement around (was formerly at https://develop.battle.net/documentation/guides/migration-guide).

I suspect you got this from the “Battle.net OAuth APIs – CN” documentation (at https://develop.battle.net/documentation/battle-net/oauth-apis-cn) that simply has never been updated. In any case, those old URLs have not worked for many years.


The problem isn’t that the URLs are wrong, it’s that they work and respond as you’d expect, but they don’t seem to recognize the non-CN OAuth clients.

my current working code uses the following urls

'urlbase'					=> 'https://us.api.blizzard.com',
'AUTHORIZATION_ENDPOINT'	=> 'https://oauth.battle.net/authorize',
'TOKEN_ENDPOINT'			=> 'https://us.battle.net/oauth/token',
'ACCOUNT_ENDPOINT'			=> 'https://us.battle.net',

not that i am using the OLD urls and they work same applies all regions, im not sure maybe the code is locked because of the china stuff im not sure all i know is the old urls still work but i have had issues with the new ones the only one that i had to change was the AUTHORIZATION_ENDPOINT i know the cn region has had ALOT of issues for a while

China web api is still not working?