跳转至

通过认证 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 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 验证错误代码