Verifying a Token
Description
This API is used to verify the validity of a token. After receiving the request, the server verifies the token validity and returns the result. If needGenNewToken is set to true, a new token is generated and returned.
Debugging
You can debug this API in API Explorer.
Prototype
Request Method |
POST |
---|---|
Request Address |
/v1/usg/acs/token/validate |
Transport Protocol |
HTTPS |
Request Parameters
Parameter |
Mandatory |
Type |
Location |
Description |
---|---|---|---|---|
Content-Type |
Yes |
String |
Header |
Media format of the body, for example, application/json; charset=UTF-8. |
X-Request-ID |
No |
String |
Header |
Request ID, which is used for fault tracing and locating. You are advised to use a UUID. If this parameter is not carried, a request ID is automatically generated. |
Accept-Language |
No |
String |
Header |
Language. Values: zh-CN for Chinese (default) and en-US for English. |
token |
Yes |
String |
Body |
Access token. |
needGenNewToken |
Yes |
Boolean |
Body |
Whether to generate a new token.
|
needAccountInfo |
No |
Boolean |
Body |
Whether to return user account details (such as the account and username). |
Status Codes
HTTP Status Code |
Description |
---|---|
200 |
Operation successful. |
400 |
Invalid parameters. |
401 |
Authentication is not performed or fails. |
403 |
Insufficient permissions. |
500 |
Server exception. |
Response Parameters
Parameter |
Type |
Description |
---|---|---|
accessToken |
String |
Access token. |
clientType |
Integer |
Type of the account used for login.
|
createTime |
Long |
Timestamp when the token is created, in milliseconds. |
daysPwdAvailable |
Integer |
Password validity period. |
delayDelete |
Boolean |
Whether the token deletion is delayed. |
expireTime |
Long |
Timestamp when the token expires, in seconds. |
firstLogin |
Boolean |
Whether the login is the first login.
NOTE:
If you log in to the system for the first time, the system prompts you to change the initial password. Default value: false. |
forceLoginInd |
Integer |
Whether preemptive login is enabled.
|
proxyToken |
ProxyTokenDTO object |
Proxy authentication information. |
pwdExpired |
Boolean |
Whether the password has expired. Default value: false. |
refreshCreateTime |
Long |
Timestamp when a refresh token is created, in milliseconds. |
refreshExpireTime |
Long |
Timestamp when the refresh token expires, in seconds. |
refreshToken |
String |
Refresh token. |
refreshValidPeriod |
Long |
Validity period of the refresh token, in seconds. |
tokenIp |
String |
IP address of the user. |
tokenType |
Integer |
Token type.
|
user |
UserInfo object |
User authentication details. |
validPeriod |
Long |
Validity period of the token, in seconds. |
Example Request
POST /v1/usg/acs/token/validate Connection: keep-alive Content-Type: application/json Host: api.meeting.huaweicloud.com User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_191) { "needGenNewToken": false, "needAccountInfo": true, "token": "stbNYluHvordsmyF2Ubt271qDr6WDAVLtLRb" }
Example Response
HTTP/1.1 200 Date: Wed, 18 Dec 2019 06:20:40 GMT Content-Type: application/json;charset=UTF-8 Content-Length: 143 Connection: keep-alive X-Request-Id: f90fbd8714328398fcbedddde0f1303c { "accessToken": "stbNYluHvordsmyF2Ubt271qDr6WDAVLtLRb", "tokenIp": "10.8.0.130", "validPeriod": null, "expireTime": 1582901905, "createTime": null, "user": { "userId": "zhangsan@cloudlinkwp", "ucloginAccount": "zhangsan@cloudlinkwp", "serviceAccount": "sip:878587543144724349434080@huaweicloud.com", "numberHA1": "1ead5e5ce44849bc2718d5cb479c890f", "alias1": null, "companyId": "12345", "spId": "3be969ebb05a4723a234d534bcf36680", "companyDomain": null, "realm": "huawei.com", "userType": 2, "adminType": 2, "name": "zhangsan", "nameEn": null, "isBindPhone": null, "freeUser": false, "thirdAccount": "zhangsan@cloudlinkwp", "visionAccount": null, "headPictureUrl": null }, "clientType": 72, "forceLoginInd": null, "firstLogin": false, "pwdExpired": false, "daysPwdAvailable": null }
Error Codes
If an error code starting with MMC or USG is returned when you use this API, rectify the fault by following the instructions provided in Huawei Cloud API Error Center.
Example cURL Command
curl -k -i -X POST -H 'Content-Type:application/json' -d '{"needGenNewToken":false,"needAccountInfo":true,"token":"stbNYluHvordsmyF2Ubt271qDr6WDAVLtLRb"}' 'https://api.meeting.huaweicloud.com/v1/usg/acs/token/validate'
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot