Skip to content

Discussion on usage #41

@ningmeng52022

Description

@ningmeng52022
          ## Here is another way without having to use the Battle.net App 

1. Retrieve SSO Token:

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"}
  • 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"}

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}

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}

6. Add Authenticator to Password Manager.

  • After you have obtianed the deviceSecret convert it from hex to base32 using echo "deviceSecret" | xxd -r -p | base32 on Linux/macOS or cryptii.com if on Windows

  • Replace deviceSecret in the following URL: otpauth://totp/Battle.net?secret=deviceSecret&digits=8 with the newly obtained base32 device secret, and you should have a working TOTP.

Originally posted by @BillyCurtis in #38 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions