【问题标题】:Missing refresh_token when using authorization code with PKCE将授权码与 PKCE 一起使用时缺少 refresh_token
【发布时间】:2021-09-28 09:36:12
【问题描述】:

在使用 PKCE 的 oauth2 代码流授权管理 api 后,来自POST https://login.tapkey.com/connect/token 的响应不返回刷新令牌。我错过了什么吗?

用户重定向到https://login.tapkey.com/connect/authorize?client_id=[...]&redirect_uri=[...]&scope=write%3Agrants&response_type=code&state=[...]&code_challenge=[...]&code_challenge_method=S256"

在回调之后,我使用以下表单数据请求POST https://login.tapkey.com/connect/token

 [
  "grant_type" => "authorization_code"
  "client_id" => "[...]"
  "client_secret" => null
  "code" => "[...]"
  "redirect_uri" => "[...]"
  "code_verifier" => "[...]"
]

我得到的回应是

[
  "access_token" => "[...]"
  "expires_in" => 3600
  "token_type" => "Bearer"
  "scope" => "write:grants"
]

【问题讨论】:

  • 能否请您也添加您的请求。
  • 当然,我编辑了问题。

标签: pkce tapkey


【解决方案1】:

就像这里https://developers.tapkey.io/api/authentication/pkce/#refreshing-an-access-token 中描述的那样,要获得refresh_token,您还需要请求范围“offline_access”。

【讨论】:

  • 是的!我只是盲目地阅读文档。谢谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-09
  • 2020-03-26
  • 2018-01-22
  • 2020-11-07
  • 2020-11-27
  • 2015-04-18
相关资源
最近更新 更多