Refresh id_token
Calling this API refreshes the id_token. If session_token automatic refresh is configured, this API also refreshes the session_token. The application needs to save the new session_token. If session_token automatic refresh is not configured, the original session_token and the new id_token are returned.
Request Description
Request Headers
| Parameter Name | Name | Required | Type | Example |
|---|---|---|---|---|
| X-operating-sys-version | Caller client operating system 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 |
| session-token | Session token | Yes | String | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWJqZWN |
| content-type | Content format type | Yes | String | application/json |
Request Example
None
Request Parameters
None
Response Example
Success Example
HTTP/1.1 200 OK
json
{
"session_token":"nRUxqRE5TSlQwd3NBIiwiaW",
"expire": 604800,
"id_token": "eyJraWQiOiI0NjJXEuY29tIn0.Jz3pZhvpVQDK99SSwR_SnJE1w0.69wHREjAhMw4Q2uo7CX"
}Error Example
HTTP/1.1 400 Bad Request
json
{
"error_code": "IDAAS.SDK.PARAM.0023",
"error_msg": "Invalid or expired session token"
}Response Parameters
| Parameter Name | Name | Type | Description |
|---|---|---|---|
| expire | session_token validity period | Number | session_token validity period; within the validity period, session_token can be used to obtain id_token |
| 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 interface call token | String | This field is in JWT format and contains user identity information. For details, see Get User Info from id_token. The token validity period defaults to 5 minutes. |
Error Codes
| Status Code | Error Code | 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.0022 | 会话令牌不能为空 | Session token cannot be empty | Please check whether the input session token is empty |
| 400 | IDAAS.SDK.PARAM.0023 | 会话令牌无效或已过期 | Invalid or expired session token | Please re-acquire the session token and try again |
| 400 | IDAAS.SDK.COM.0002 | 系统繁忙,请稍后再试 | System busy, please try again later | Please call again or contact BambooCloud support staff |