One-Click Mobile Login
During the API call, on success the user'ssession_token,is returned; otherwise, failure information is returned. Auto-registration can be supported based on Enterprise Center registration configuration.
Request Description
Request Headers
| Parameter Name | Chinese Name | Required | Type | Example |
|---|---|---|---|---|
| X-operating-sys-version | Caller client OS version | Yes | String | windows10.1.1 |
| X-device-fingerprint | Caller client device fingerprint | Yes | String | 156aysdna213sc50 |
| X-device-ip | Caller client IP | No | String | 192.168.1.2 |
| X-agent | User-Agent information | Yes | String | Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) |
| X-L | Used for internationalization language setting | No | String | zh |
| X-client-id | Application authorization ID | Yes | String | nTo1eRIub60vPb54WeE6aojPwYwImtl4 |
| content-type | Content format type | Yes | String | application/json |
Request Example
json
{
"access_token":"ad12sasdsfe3dfdg3sc"
}Request Parameters
| Parameter Name | Chinese Name | Required | Type | Description |
|---|---|---|---|---|
| access_token | Authorization TOKEN | Yes | String | Authorization TOKEN [authorization TOKEN provided by the Alibaba Cloud service provider】 |
Response Example
Success Example
HTTP/1.1 200 OK
json
{
"session_token": "btsiBjx85prcZu6I6Ki057Tmw3nSF2VO",
"expire": 432000,
"status": "SUCCESS",
"id_token": "eyJ0NiJ9.eyJ1cI6IjIifX0.DeWt4QuZXso"
}Error Example
HTTP/1.1 400 Bad Request
json
{
"error_code": "IDAAS.SDK.PARAM.0001",
"error_msg": "Device information is incomplete"
}Response Parameters
| Parameter Name | Chinese Name | Type | Description |
|---|---|---|---|
| status | Login flow status identifier | String | Possible values returned by this field are as follows: SUCCESS: login successful |
| expire | session_token validity period | Number | Session_token validity period. Within the validity period, session_token can be used to obtain ticket |
| session_token | User session_token | String | User session_token; this token can be used to call IDaaS APIs to obtain a new id_token |
| id_token | Short-term valid API call token | String | This field is in JWT format and contains user identity information. Refer toGet User Info from id_tokento obtain user information. The token validity period is5minutes by default and can be configured |
Error Codes
| Status Code | Error Codes | Chinese Error Message | English Error Message | Resolution |
|---|---|---|---|---|
| 400 | IDAAS.SDK.PARAM.0001 | 设备信息不完整 | Device information is incomplete | Please check whether the input device information is complete |
| 400 | IDAAS.SDK.PARAM.0002 | clientId不能为空 | clientId cannot be empty | Please check whether the input clientId is empty |
| 400 | IDAAS.SDK.PARAM.0003 | 应用未注册,请先注册应用 | The app is not registered, please register the app first | Please check whether the input clientId is correct |
| 400 | IDAAS.SDK.USER.0001 | 用户未找到 | User not found | Please register first and try again |
| 400 | IDAAS.SDK.USER.0039 | 用户已被禁用 | User is disabled | Please contact the administrator |
| 500 | IDAAS.SDK.COM.0002 | 系统繁忙,请稍后再试 | System busy, please try again later | Please call again or contact BambooCloud staff |