Exchange session_token for id_token API
Calling this API will refresh the id_token. If automatic refresh of session_token is configured in the console, this API will also refresh the session_token.
Request Description
Request Headers
| Parameter Name | Name | Required | Type | Description |
|---|---|---|---|---|
| X-operating-sys-version | Caller OS version | Yes | String | windows10.1.1 |
| X-device-fingerprint | Caller device fingerprint | Yes | String | 156aysdna213sc50 |
| X-device-ip | Caller IP | No | String | 192.168.1.2 |
| X-agent | User-Agent info | Yes | String | Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15(KHTML, like Gecko) Mobile/15E148/HuaWei-AnyOffice/2.6.1802.0010/com.huawei.cloudlink.workplace |
| X-L | Used for internationalization language setting | No | String | zh |
| X-client-id | Application authorization ID | Yes | String | nTo1eRIub60vPb54WeE6aojPwYwImtl4 |
| X-session-token | Session credential | Yes | String | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWJqZWN |
Request Parameters
None
Response Example
Success Example
HTTP/1.1 200 OK
json
{
"session_token":"nRUxqRE5TSlQwd3NBIiwiaW",
"expire": 604800,
"id_token": "eyJraWQiOiI0NjJhYjY0OTM0Zjk0ZTRmOGE4MjU2Mzc4YzgyMTVlMiIsImFsZyI6IlJTMjU2In0.eyJpc3MiOiJodHRwczovL21oLmlkYWFzLXRlc3QtYWxwaGEuYmNjYXN0bGUuY29tL2FwaS92MS9vYXV0aDIiLCJhdWQiOiJwT0p1YVhHSmRqNFZzTzZmaVFRaUpia3JxSXFIMTZqNiIsInN1YiI6ImFkbWluIiwiZXhwIjoxNjQ2ODgzNzc5LCJqdGkiOiJaa1hnZ3FCZzZnRUxqRE5TSlQwd3NBIiwiaWF0IjoxNjQ2ODc2NTc5LCJuYmYiOjE2NDY4NzY0NTksImlkIjoiMjAyMjAxMjYxNDE1MDc5MjAtQzlCNy0xMjRGMzVCNEQiLCJuYW1lIjoiYWRtaW4xMSIsInVzZXJOYW1lIjoiYWRtaW4iLCJtb2JpbGUiOiIrODYtMTgyNzE5NDkwNTUiLCJlbWFpbCI6ImFhc2RAcXEuY29tIn0.Jz3pZhvpVQDKXyPaeDYar4jKNi9m3liXqgM4qHb8pWVbi0D8OpgYFYCX-LzSqEfU6ex_ix9_nctHXsPt-4wdhX75eMrQXZFCO4mwGpsdKQBAqSkKJ6Vv53j_Ptr6Lu87dVDPX9SqL3yv3KpNP6hfn74ShQVE23BXfm12-KAY8otJUdeL2OS3v0N7xdjgaYeIAXf7LhrMEo1tNCRCY8uuCKjC280yIKtrRSC86oB5hEW-QFTjtt938TV4cpb1x6zO99SSwR_SnJE1w069wHREjAhMw4Q2uo7CXqPojn5oUrIvlE8GuXwoYFFQand4IgNPMk-EnPT4NLVJ8oEoRsydhg"
}Error Example
HTTP/1.1 400 Bad Request
json
{
"error_code": "SDK.COMMON.1001",
"error_msg": "Parameter X-client-id cannot be blank"
}
{
"error_code": "SDK.COMMON.1006",
"error_msg": "session_token parameter error"
}
{
"error_code": "SDK.COMMON.1005",
"error_msg":"LgTZcmcTAJZnqylkzlTjubV24iI8a1jF1 has expired"
}Response Parameters
| Parameter Name | Name | Type | Description |
|---|---|---|---|
| expire | session_token validity period | Number | Validity period of session_token; within the validity period, you can use session_token to obtain id_token |
| session_token | User session_token | String | User session_token; you can use this token to call the IDaaS API to obtain id_token |
| id_token | Short-term valid API call credential | String | This field is a JWT that stores user information and the application's scope information, which needs to be obtained after signature verification; valid for 2 hours by default and supports configuration |