Confirmed users
927
edits
Tarek.ziade (talk | contribs) |
Tarek.ziade (talk | contribs) |
||
| Line 286: | Line 286: | ||
'''Unless stated otherwise, all APIs are using application/json for the requests and responses content types.''' | '''Unless stated otherwise, all APIs are using application/json for the requests and responses content types.''' | ||
== | == GET /1.0/<app_name>/token == | ||
Asks for new token given some credentials in the Authorization header. | |||
By default, the authentication scheme is Browser ID but other schemes can potentially be used if supported by the login server. '''app_name''' is the name of the application to access, like '''sync'''. | |||
but | |||
'''app_name''' is the name of the application to access, like '''sync''' | |||
Example for Browser-Id: | Example for Browser-Id: | ||
<pre> | <pre> | ||
GET /1.0/sync/token | |||
Host: token.services.mozilla.com | Host: token.services.mozilla.com | ||
Content-Type: application/json | Content-Type: application/json | ||
Authorization: Browser-ID <assertion> | |||
</pre> | </pre> | ||
| Line 335: | Line 328: | ||
* 404 : unknown URL (0), or unsupported application (1). | * 404 : unknown URL (0), or unsupported application (1). | ||
* 400 : malformed request - missing option or bad values(2) or malformed json (3) or unsupported authentication protocol (4) | * 400 : malformed request - missing option or bad values(2) or malformed json (3) or unsupported authentication protocol (4) | ||
* 401 : authentication failed (5) | * 401 : authentication failed or protocol not supported (5). The response in that case will contain WWW-Authenticate headers (one per supported scheme) | ||
* 405 : unsupported method (6) | * 405 : unsupported method (6) | ||
* 406 : unacceptable - the client asked for an Accept we don't support (7) | * 406 : unacceptable - the client asked for an Accept we don't support (7) | ||