【问题标题】:How to refresh the tokens in Apple如何在 Apple 中刷新令牌
【发布时间】:2020-09-21 22:38:55
【问题描述】:

场景: 令牌过期后不应注销用户。

Apple 注册步骤:

  1. 成功验证授权码并获得成功响应 { "access_token" : "",,"refresh_token" : "",expires_in: ""}

  2. 成功验证了从上述步骤获得的 refresh_token,并使用对https://appleid.apple.com/auth/token的 POST 调用生成了新的访问令牌

问题: 如何从新的访问令牌生成用户数据,id_token?

【问题讨论】:

    标签: oauth access-token refresh-token apple-id


    【解决方案1】:

    Apple 的生态系统中现在没有 UserInfo API。 他们的访问令牌根本没用。

    获取用户显示名称的唯一方法是在第一次授权时在回调 url 处接收“用户”json 对象。 对于电子邮件,您也可以在 id_token 中获取。

    【讨论】:

    • 首次授权似乎工作正常。当我们验证 refresh_token 时,我们只收到 {access_token: "","token_type:"bearer","expires_in":3600} 没有 id_token 或 refresh_token 返回。:(
    猜你喜欢
    • 2020-12-13
    • 1970-01-01
    • 2021-06-19
    • 2020-07-12
    • 2017-05-29
    • 2019-04-17
    • 2021-08-25
    • 2020-12-05
    • 2023-03-16
    相关资源
    最近更新 更多