Token 驗證
位置 | 參數 | 名稱 | 類型 | 描述 |
{1} | body | appId | string | 內容用來請求存取 VIVEPORT 內部服務的 VIVEPORT ID |
{2} | body | serviceToken | string | 從服務 Token 管理中取得的 token |
{3} | body | userToken | string | 從 Session Token API 中取得的 token |
HTTP 方法:POST
URL:
https://www.viveport.com/api/thirdpartygatewayservice/v2/monitor/tokens/validate
驗證現有 token 並回傳可用於身份驗證的 userId。
回應範例
curl -X POST
"https://www.viveport.com/api/thirdpartygatewayservice/v2/monitor/tokens/validate"
-H "accept: application/json"
-H "Content-Type: application/json"
-d "{
\"appId\":\"SampleApp\",
\"serviceToken\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJleHAiOjE1MjUzMzQ2NzcsImlhdCI6MTUyNTMzMTA3NywiZHVyYXRpb24iOjM2MDB9.HsdxbtW9-o-d6I_U_gZGS7yE5g4DzD5P39ZnHBq4YU5LCtiz5-UhyNDjEoiqJ-_Z3OJLJYRgD2mX2Gy4YENkdXFA9wV0gi6qC8-5YWHHWFBleQyaDmtH0jUdm6P_pGZgvlMniGsnQaAObzcIh2CRGFZycpqmGzFrSYVaJdqrPtcSm-eJGDTihIgoisZrvZmxYLDQi5cwdoCK-Z3VLyjgsWNVQ-Hg9t6m1kVuKLdjLFkLzTk18NqlpFZ-8yDU2vgrBNFoSzBlDDGozFBho1AKF_Xc8NVqhfNZzKF7mv0NkVzVo8g5FesPQUpNrZY4a2RKdWP0fdIfWL2OfFPx8G-Uqw\",
\"userToken\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJleHAiOjE1MjUzMzQ2OTgsImlhdCI6MTUyNTMzMTA5OCwiZHVyYXRpb24iOjM2MDB9.IKf9D1QR4eLSYChVWxT2YmbNQL7f6KUKFoRYMxsNLwNipr4Fg-YHDp65oh7CopnX-G8SCovMh5HvDXPFEFGP9bWzrLaDXN_gjSVvI38ut3qrj-q5NSqm7DVK6blCPSK2Qh9YdTDm_1q3nDBX_C-qQvuooJ4hL2b6zK0Q4yLukcR2a2QvIUF82QJVIVb1Oa5qSVCYXSnjY71j4w9AcYmDecQmtMperk3q1fF5nGonafiMOb9s88zwCyGRe_LESt5czWCpivwWa38Gm24oq2NxwqW_LJrZ9ARy_2MqogKQJwJQXv3IAN6QT79hEnFnqaQKsgd94D2DxL4MF2W7slfRjw\"
}"
HTTP/1.1 200 OK
{
"publicName": “userPublicName”,
"userId": "1db96bde-c48e-48f6-8b61-7d3d550068ab"
}
Token 驗證的錯誤代碼
類型 | 描述 |
400 Bad request | 無效的有效載荷 |
403 Forbidden | VIVEPORT 伺服器無法解密服務 Token |
406 Not Acceptable | VIVEPORT 伺服器無法從 Session Token API 解密 userToken |
500 Internal Server Error | 服務 Token 過期錯誤 |