Apple Login
AppleDuring the login API call, different results are returned depending on configuration. On normal success, the user'ssession_token,if not bound, state_token is returned,failure information is returned.
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
{
"code":"ad12sasdsfe3dfdg3sc"
}Request Parameters
| Parameter Name | Chinese Name | Required | Type | Description |
|---|---|---|---|---|
| code | Apple authorization code | Yes | String | Authorization code [applaunchAppleprovided authorization code |
Response Example
Success Example1(successful match returns session_token)
HTTP/1.1 200 OK
json
{
"session_token": "btsiBjx85prcZu6I6Ki057Tmw3nSF2VO",
"expire": 432000,
"status": "SUCCESS",
"id_token": "eyJ0NiJ9.eyJ1cI6IjIifX0.DeWt4QuZXso"
}Success Example2(returns auto-registration and binding flow)
HTTP/1.1 200 OK
json
{
"state_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
"data": "{\"socialBindOrRegisterFlow\":[\"VERIFY_PHONE\",\"VERIFY_EMAIL\"]}",
"status": "USER_REGISTER"
}Success Example3(returns binding flow)
HTTP/1.1 200 OK
json
{
"state_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
"data": "{\"socialBindOrRegisterFlow\":[\"VERIFY_PHONE\",\"VERIFY_EMAIL\"]}",
"status": " SOCIAL_BIND"
}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 SOCIAL_BIND: binding flow USER_REGISTER: auto-registration and binding flow ACCESS_DENIED: access denied |
| 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 |
| state_token | User state token | String | User state 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 |
| data | Return description | String | Tenant social registration and binding flow configuration information; the socialBindOrRegisterFlow field contains the verification methods supported by the tenant VERIFY_PHONE: mobile number + SMS verification code VERIFY_EMAIL: email + email verification code |
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.PARAM.0011 | Apple授权码不能为空 | Apple authorization code cannot be empty | Please check whether the input Apple authorization code is empty |
| 500 | IDAAS.SDK.COM.0002 | 系统繁忙,请稍后再试 | System busy, please try again later | Please call again or contact BambooCloud staff |
| 400 | IDAAS.SDK.USER.0039 | 用户已被禁用 | User is disabled | Please contact the administrator |