-
Notifications
You must be signed in to change notification settings - Fork 36
Description
## Here is another way without having to use the Battle.net App
1. Retrieve SSO Token:
- Go to https://account.battle.net/login/en/?ref=localhost. After logging in, ignore the 404 Error, but copy the token following ST= from the URL.
- Example:
EU-84902f44j57m687039586j7egdfa0a54-1165739690
- Example:
2. Get Bearer Token:
-
Replace
<SSO_TOKEN>with the token you got from step 1 and execute the following curl command to obtain the Bearer Token:curl -X 'POST' \ 'https://oauth.battle.net/oauth/sso' \ -H "content-type: application/x-www-form-urlencoded; charset=utf-8" \ -d "client_id=baedda12fe054e4abdfc3ad7bdea970a&grant_type=client_sso&scope=auth.authenticator&token=<SSO_TOKEN>"
- Response:
{"access_token":"XXX","token_type":"bearer","expires_in":0,"scope":"auth.authenticator","sub":"XXX"}
- Response:
-
Copy the Bearer Token to use in steps 3, 4. or 5.
3. Get Serial & Restore Codes:
-
Use the Bearer Token to fetch the Serial and Restore Codes of an existing authenticator:
curl -X 'GET' \ 'https://authenticator-rest-api.bnet-identity.blizzard.net/v1/authenticator' \ -H 'accept: application/json' \ -H "Authorization: Bearer <BEARER_TOKEN>"
- Response:
{"Restore Code": "XXX", "Serial Number": "XXX"}
- Response:
4. Get Existing Authenticator Device Secret:
-
Use the Bearer Token, Serial, and Restore codes to retrieve the Device Secret of an Existing Authenticator:
curl -X 'POST' \ 'https://authenticator-rest-api.bnet-identity.blizzard.net/v1/authenticator/device' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer <BEARER_TOKEN>" \ -d '{ "restoreCode": "<RESTORE_CODE>", "serial": "<SERIAL>" }'
- Response:
{"serial":"XXX","restoreCode":"XXX","deviceSecret":"XXX","timeMs":0,"requireHealup":false}
- Response:
5. Create and Add a New Authenticator:
-
Use the Bearer Token to create and add a new authenticator to the users account :
curl -X 'POST' \ 'https://authenticator-rest-api.bnet-identity.blizzard.net/v1/authenticator' \ -H 'accept: application/json' \ -H "Authorization: Bearer <BEARER_TOKEN>" \ -d ''
- Response:
{"serial":"XXX","restoreCode":"XXX","deviceSecret":"XXX","timeMs":0,"requireHealup":false}
- Response:
6. Add Authenticator to Password Manager.
-
After you have obtianed the
deviceSecretconvert it from hex to base32 usingecho "deviceSecret" | xxd -r -p | base32on Linux/macOS or cryptii.com if on Windows -
Replace
deviceSecretin the following URL:otpauth://totp/Battle.net?secret=deviceSecret&digits=8with the newly obtained base32 device secret, and you should have a working TOTP.
Originally posted by @BillyCurtis in #38 (comment)