เรียกดูข้อมูลผู้ใช้ด้วย Authentication API¶
Request this API when user information must be checked separately after web login is completed.
This API operates by server-to-server communication from the app server directly to the Hive authentication server. It returns user information for the IdP using appid, idp_index, and idp_user_id from the response of the Login verification and user information retrieval API.
URL คำขอ¶
| URL ใช้งานจริง | https://auth.qpyou.cn/v2/game/player/get-playerid |
|---|---|
| URL สภาพแวดล้อมแบบกระจาย | https://auth.globalwithhive.com/v2/game/player/get-playerid |
| URL Sandbox | https://sandbox-auth.qpyou.cn/v2/game/player/get-playerid |
| วิธี HTTP | POST |
| Content-Type | application/json |
| รูปแบบข้อมูล | JSON |
Note
The Hive authentication server is configured as a distributed environment in preparation for failures or network communication issues.
If communication with the authentication server host fails or exceeds the timeout defined on the app server, the app server must directly call the distributed environment URL (Fallback URL).
ส่วนหัวคำขอ¶
| ชื่อฟิลด์ | คำอธิบาย | ประเภท | จำเป็น |
|---|---|---|---|
| X-Access-Token | OAuth 2.0 Access Token สำหรับการรับรองความถูกต้องของเซิร์ฟเวอร์แอป (ดู ออก OAuth Token) | String | Y |
| ISCRYPT | ข้อมูลถูกเข้ารหัสหรือไม่ (0 = ไม่เข้ารหัส) (ต้องส่ง 0 เสมอ) | Integer | Y |
เนื้อหาคำขอ¶
| ชื่อฟิลด์ | คำอธิบาย | ประเภท | จำเป็น |
|---|---|---|---|
| appid | App ID | String | Y |
| idp_index | IdP index IdP list | Integer | Y |
| idp_user_id | Unique IdP identifier | String | Y |
ตัวอย่างคำขอ¶
{"appid":"com.com2us.hivesdk.normal.freefull.apple.global.ios.universal","idp_index":1,"idp_user_id":"68101398"}
เนื้อหาการตอบกลับ¶
| ชื่อฟิลด์ | คำอธิบาย | ประเภท |
|---|---|---|
| result_code | รหัสตอบกลับ รายละเอียด | Integer |
| result_msg | ข้อความผลลัพธ์ | String |
| token_validation | ผลการตรวจสอบ JWT (ข้อผิดพลาดการตรวจสอบ JWT) | Object |
| token_validation.result_code | รหัสผลการตรวจสอบ JWT | Integer |
| token_validation.result_msg | ข้อความผลการตรวจสอบ JWT | String |
| data | ข้อมูลผลลัพธ์ | Object |
| data.enc_idp | Key that encrypts Request Body information | String |
| data.player_id | Player ID | BigInteger |
| data.list | Linked IdP list | Array |
| data.list[].seq | Linked IdP list - Seq | BigInteger |
| data.list[].player_id | Linked IdP list - Player ID | BigInteger |
| data.list[].idp_user_id | Linked IdP list - unique IdP identifier | String |
| data.list[].idp_index | Linked IdP list - IdP index IdP list | Integer |
| data.list[].idp_id | Linked IdP list - IdP ID | String |
| data.is_blocked | Whether use is suspended | Boolean |
| data.is_refund | Whether the refunded user is subject to repayment | Boolean |
รหัสตอบกลับ¶
| Code value | คำอธิบาย |
|---|---|
| 0 | สำเร็จ |
| 2002 | No user data |
| 2499 | การตรวจสอบ JWT ล้มเหลว (ดู token_validation) |
| 4000 | Invalid request parameter |
ตัวอย่างการตอบกลับ¶
สำเร็จ (user information exists)¶
{"result_code":0,"result_msg":"SUCCESS","token_validation":{"result_code":0,"result_msg":"success"},"data":{"enc_idp":"K+A4xduO7kf5OrJ/iDPqL0PtMxwu7wW8JSBO+JJwSDDmJLvIi/6LG7TyWXdEHr9RNHM+/QXwc0+Y9z2eSRg7oeBBHmpOajzF1iiaacbFom4CsNy2fItendset7T0i0WYdyLQih3z5mDjcct47+gg2ovbp6kWRY8D+aGq+ZgaKiyr0Hmb1xmbWY/7cl1FjXTm0Nl9CWhO418bJFdwOpi+bw==","player_id":20000016588,"list":[{"seq":25771,"player_id":20000016588,"idp_user_id":"68101398","idp_index":1,"idp_id":"HIVE"},{"seq":25772,"player_id":20000016588,"idp_user_id":"0","idp_index":0,"idp_id":"GUEST"}],"is_blocked":false,"is_refund":false}}
สำเร็จ (no user information)¶
{"result_code":2002,"result_msg":"No User","token_validation":{"result_code":0,"result_msg":"success"},"data":{"enc_idp":"K+A4xduO7kf5OrJ/iDPqLyCHfP+L3wz0WTNVw5KHLCqYjqQ+shQ2P3mkgwYCMvlnPatzlSE5ZFINr5gEIxK14sg0N8kOPSjSCeQ9UGGt11OMrYsGTuys0KmPJ2ZU/UWVVxpP1Lxx1eS8VbYwLmoTG+HTw2vkocghs/ZOZ9rqisdBRprhp6Q6+lIjpaUzDa2yy2guM1WheuVzKGL5331HHgo557RqoyUzTc6Lkf8ArWZ/XSwi3ZmStmhz/U4thcIwiowqgV+Ecdb2+WmMZ1MgGT4Xvbxa4lqzToBC3nxDvi1d8TjgMaszVYoNct94WPBGvV6emg3GqiJG+0ZTGg53+mZad9ttkUpTnQXetz5UDTxe5NnFAYfffzBq3jkqfAB042eH21rE3uTVJq3HuO8i9t1LJwKFfkC7sjjuaKNWsjs="}}
JWT validation failure¶
{
"result_code": 2499,
"result_msg": "JWT validation failed. See token_validation for details.",
"token_validation": {
"result_code": 2408,
"result_msg": "The access token is expired. Please refresh your token."
}
}
ล้มเหลว¶
{"result_code":4000,"result_msg":"Request has invalid format.","data":"appid, idp_user_id, idp_index"}
Note
เมื่อการตรวจสอบ JWT ล้มเหลว คุณสามารถดูข้อมูลข้อผิดพลาดโดยละเอียดได้ในฟิลด์ token_validation โปรดดู รหัสข้อผิดพลาดการตรวจสอบ JWT สำหรับรายละเอียด