IdP 列表查询¶
使用从应用程序客户端成功登录后返回的玩家 ID 和应用程序 ID,从应用程序服务器检索链接到玩家的 IdP(身份提供商)列表。 “获取 IdP 列表”API 通过服务器到服务器通信进行操作,其中应用程序服务器直接调用 Hive 身份验证服务器。请求成功后,链接的 IdP 信息将以数组形式返回到响应的数据字段中。 发起请求时,App ID 和 Player ID 为必填参数。
请求网址¶
| 生产网址 | https://auth.qpyou.cn/v2/game/player/get-idp |
|---|---|
| 分布式环境URL | https://auth.globalwithhive.com/v2/game/player/get-idp |
| 沙箱网址 | https://sandbox-auth.qpyou.cn/v2/game/player/get-idp |
| HTTP 方法 | POST |
| Content-Type | application/json |
| 数据格式 | JSON |
Note
Hive认证服务器配置在分布式环境中,以应对故障或网络通信不稳定的情况。
如果与认证服务器主机通信失败,或者超过应用服务器定义的超时时间,应用服务器必须直接调用分布式环境URL(Fallback URL)。
请求头¶
| 字段名称 | 描述 | 类型 | 必填 |
|---|---|---|---|
| X-Access-Token | 用于游戏服务器身份验证的 OAuth 2.0 访问令牌 (参见 OAuth 令牌签发) | String | Y |
| ISCRYPT | 数据是否加密(0 = 未加密;始终传递 0) | Integer | Y |
| ## 请求正文 | |||
| 字段名称 | 描述 | 类型 | 必填 |
| --- | --- | --- | --- |
| appid | 应用程序 ID | String | Y |
| player_id | 登录成功后返回的验证玩家ID | BigInteger | Y |
请求示例¶
{
"appid": "com.com2us.hivesdk.normal.freefull.apple.global.ios.universal",
"player_id": 90000000062
}
响应体¶
| 字段名称 | 描述 | 类型 |
|---|---|---|
| result_code | 响应代码 详情 | Integer |
| result_msg | 结果留言 | String |
| token_validation | JWT 验证结果 (JWT 验证错误) | Object |
| token_validation.result_code | JWT验证结果码 | Integer |
| token_validation.result_msg | JWT 验证结果消息 | String |
| data | IdP 列表数据 | Array |
| data[].seq | 用户主键(PK) | BigInteger |
| data[].player_id | 玩家ID | BigInteger |
| data[].idp_user_id | IdP 提供的用户 ID 值 | String |
| data[].idp_index | IdP 唯一编号 详情 | Integer |
| data[].idp_id | IdP 的字符串值 | String |
结果代码¶
JWT 验证失败¶
{
"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."
}
}
Note
当JWT验证失败时,您可以在token_validation字段中查看详细的错误信息。详细信息请参见JWT 验证错误代码。
IdP 索引¶
有关 IdP 索引信息,请参阅 IdP 列表。