Login operation
The feature described in this topic is available only in preview. To use this feature and other new Windows Azure capabilities, sign up for the free preview.
Requests a service-specific token for an authenticated user.
The request may be specified as follows. Replace <service_name> with your mobile service name and <table_name> with the name of the table to access.
| HTTP Verb | Request URI | HTTP Version |
|---|---|---|
|
POST |
|
HTTP/1.1 |
URI Parameters
Windows Azure Mobile Services supports the following parameter.
| URI Parameter | Required | Description |
|---|---|---|
|
mode |
Yes |
Specify a value of authenticationToken. In this release, only Live Connect authentication is supported. |
Request Headers
The following table describes the request headers.
| Request Header | Required | |
|---|---|---|
|
Accept |
No |
Set this header to application/json. |
|
Content-Length |
Yes |
The length of the request body. |
|
Content-Type |
No |
Set this header to application/json. |
Request Body
The request body contains a single object, expressed in JavaScript Object Notation (JSON). This object contains a single authenticationToken property that contains the token provided by Live Connect after positive authentication of the user.
The response includes an HTTP status code, a set of response headers, and a response body.
Status Code
A successfully operation returns status code 200 (OK).
Response Headers
The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.
| Response Header | Description |
|---|---|
|
Content-Length |
The length of the response body. |
|
Content-Type |
Header set to application/json. |
|
x-zumo-version |
Indicates which version of the runtime executed the request. |
Response Body
The request body contains a single JSON object with two properties. The following table describes the properties of the JSON object in the response body.
| Property Name | Description |
|---|---|
|
user |
JSON object that contains the userId value assigned by Windows Azure Mobile Services to the authenticated user. |
|
authenticationToken |
The original authentication token provided in the request. |
Requires a valid authentication token from a known and trusted authentication service.
The following example URI sends a login request for a user based on the supplied authentication token.
POST https://todolist.azure-mobile.net/login?mode=authenticationToken
The request is sent with the following headers.
Accept: application/json X-ZUMO-APPLICATION: UzMAOXRlJdZyqibeUqCMoZZMrUXIRs92 Content-Type: application/json Host: todolist.azure-mobile.net Content-Length: 504
The request is sent with the following JSON object in the body (without line breaks).
{"authenticationToken":"eyJhbGciOiJIUzI1NiIsImtpZCI6IjAiLCJ0eXAiOiJKV1QifQ.eyJ2ZXIiOjEsImlzcyI6InVybjp3aW5kb3dzOmxpd
mVpZCIsImV4cCI6MTM0ODI5NzQ0MSwidWlkIjoiY2IzOTJjZWFlMjRhNDQ0MDhlZDg2MzQ4MmIyMGYyNzQiLCJhdWQiOiJ0b2RvbGlzdC5henVyZS1tb2J
pbGUubmV0IiwidXJuOm1pY3Jvc29mdDphcHB1cmkiOiJtcy1hcHA6Ly9TLTEtMTUtMi0yMTc2MjE0Mzc3LTI3OTEzMzQ5NjYtMzMwOTg2MjIyMS0xMjIzO
Dk3ODItMTQ2Nzk5MjE5LTEyNDUyMDA4MDEtMTcwODgxMTk1MCIsInVybjptaWNyb3NvZnQ6YXBwaWQiOiIwMDAwMDAwMDRDMENCMzA1In0.3IoN-SKHc5l
85TcVH-rlCdtM2jf7x1E90jcHVxzoa3k"}
After the request has been sent, the following response is returned.
HTTP/1.1 200 OK
Content-Type: application/json
x-zumo-version: Zumo.Main.0.1.6.527.Runtime
Date: Fri, 21 Sep 2012 07:10:53 GMT
Content-Length: 462
{"user":{"userId":"MicrosoftAccount:cb392ceae24a44408ed863482b20f274"},"authenticationToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6I
kpXVCIsImtpZCI6MH0.eyJleHAiOjEzNTA4MDM0NTQuNDM4LCJpc3MiOiJ1cm46bWljcm9zb2Z0OndpbmRvd3MtYXp1cmU6enVtbyIsImF1ZCI6Ik1pY3Jvc
29mdEFjY291bnQiLCJ1aWQiOiJNaWNyb3NvZnRBY2NvdW50OmNiMzkyY2VhZTI0YTQ0NDA4ZWQ4NjM0ODJiMjBmMjc0IiwidmVyIjoxLCJ1cm46bWljcm9zb2
Z0OmFwcHVyaSI6IiIsInVybjptaWNyb3NvZnQ6YXBwaWQiOiIifQ.zvyCki11Ai7LX97ei1g3hc_4l2d2i-pL-2IsQPRJIhA"}