Customer Identity (CIAM)

Refresh id_token

Calling this API will refresh the id_token. If automatic refresh of session_token is configured, this API will also refresh the session_token. The application needs to save the new session_token. If automatic session_token update is not configured, the original session_token and the new id_token will be returned.

# Request Description

POST https://{your_domain}/api/v2/sdk/sso/session-token/id-token

# Request Headers

Parameter Name Chinese Name Required Type Example
X-operating-sys-version Calling Client OS Version Yes String windows10.1.1
X-device-fingerprint Calling Client Device Fingerprint Yes String 156aysdna213sc50
X-device-ip Calling 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 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
Content-Type: application/json
{
    "session_token":"nRUxqRE5TSlQwd3NBIiwiaW",
    "expire": 604800,
    "id_token": "eyJraWQiOiI0NjJXEuY29tIn0.Jz3pZhvpVQDK99SSwR_SnJE1w0.69wHREjAhMw4Q2uo7CX"
}


Error Example:
HTTP/1.1 400 Bad Request
{
    "error_code": "IDAAS.SDK.PARAM.0023",
    "error_msg": "Invalid or expired session token"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

# Response Parameters

Parameter Name Chinese Name Type Description
expire session_token Validity Period Number The validity period of the session_token. The id_token can be obtained using the session_token within this period.
session_token User session_token String The user's 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 to Get User Information from id_token to obtain user information. The token validity period defaults to 5 minutes.

# Error Codes

Status Code Error Code Error Message Action
400 IDAAS.SDK.PARAM.0001 Device information is incomplete Please check if the entered device information is complete.
设备信息不完整
400 IDAAS.SDK.PARAM.0002 clientId cannot be empty Please check if the entered clientId is empty.
clientId不能为空
400 IDAAS.SDK.PARAM.0003 The app is not registered, please register the app first Please check if the entered clientId is correct.
应用未注册,请先注册应用
400 IDAAS.SDK.PARAM.0022 Session token cannot be empty Please check if the entered session token is empty.
会话令牌不能为空
400 IDAAS.SDK.PARAM.0023 Invalid or expired session token Please obtain a new session token and try again.
会话令牌无效或已过期
400 IDAAS.SDK.COM.0002 System busy, please try again later Please retry the call or contact Zhuyun staff.
系统繁忙,请稍后再试

I am ready to receive the Markdown content for translation. Please paste it.