CloudServices/Sagrada/TokenServer: Difference between revisions

Line 34: Line 34:
* '''uid''': the app-specific user id (the user id integer in the case of sync)
* '''uid''': the app-specific user id (the user id integer in the case of sync)
* '''salt''': a randomly-generated salt for use in the calculation of the Token Secret (''optional'')
* '''salt''': a randomly-generated salt for use in the calculation of the Token Secret (''optional'')
* '''node''': the name of the service node to which the user is assigned


Example:
Example:


   auth_token = {"uid": 123, "expires": 1324654308.907832, "salt": "sghfwq6875765..UYgs"}   
   auth_token = {"uid": 123, "node": "https://sync-1.services.mozilla.com", "expires": 1324654308.907832, "salt": "sghfwq6875765..UYgs"}   


   
   
The token is signed using the Signing Secret and base64-ed. The signature is HMAC-SHA1:
The token is signed using the Signing Secret and base64-ed. The signature is HMAC-SHA256:


   auth_token, signature = HMAC-SHA1(auth_token, sig_secret)
   auth_token, signature = HMAC-SHA256(auth_token, sig_secret)
   auth_token = b64encode(auth_token, signature)
   auth_token = b64encode(auth_token, signature)


Confirmed users
358

edits