【问题标题】:Getting a Token from Identity Server 3从 Identity Server 3 获取令牌
【发布时间】:2017-10-30 15:16:22
【问题描述】:

我正在尝试通过驻留在另一台服务器上的应用程序的 Post Call 从 Identity Server 3 获取令牌。

我将以下值发布到https://mydomainhost.net/connect/token

curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query(array(
    'client_id' => 'myclientid',
    'client_secret' => 'myclientsecret',
    'redirect_uri' => 'http://myotherdomain.com/test.php',
    'grant_type' => 'authorization_code'
)));

但是正在返回以下错误:

string(31) "{"error":"unauthorized_client"}"

我已将“client_id”值更改为肯定未配置的用户名并获得以下信息:

string(26) "{"error":"invalid_client"}"

我只使用不存在的用户名进行测试,看看我是否得到不同的结果。

有人可以告诉我这是来自调用 Identity Server 的应用程序的错误,还是来自 Identity Server 中的配置?

【问题讨论】:

  • 您可以粘贴您的客户端配置吗?
  • 我正在尝试连接到第 3 方 - 无法从他们那里获取客户端配置。
  • 我同意 Boopathy 的回答 - 您可以在客户端配置中仔细检查 clientid 和 clientsecret。

标签: identityserver3 identityserver4 identityserver2


【解决方案1】:

通常对于此错误消息,我会检查两件事 1. 针对客户端 ID 的客户端密钥 2.客户端是否配置授权码流。

【讨论】:

  • 感谢您的回答!所以它可能来自 IdentityServer 的配置而不是 API?
  • 这是我的猜测。
猜你喜欢
  • 1970-01-01
  • 2020-11-12
  • 1970-01-01
  • 2018-06-01
  • 1970-01-01
  • 2021-09-10
  • 2017-06-29
  • 2020-07-14
  • 2018-01-05
相关资源
最近更新 更多