curl - 如何在 postman 中传递客户端凭据?

标签 curl rest-client postman

这个卷发效果很好

curl acme:acmesecret@localhost:9999/uaa/oauth/token  -d "password=password&username=user&grant_type=password" -H "Accept: application/json"

在这个 curl 中,acmeacmesecret是应用程序用来向在 localhost:9999 中运行的授权服务器进行身份验证的客户端凭据

我正在尝试使用 postman (chrome 的休息客户端)发出相同的请求。

这是屏幕截图(我在“基本身份验证”选项卡中输入了凭据)

enter image description here

下面是发出的请求的预览:(注意:添加了AUthorization基本头)

enter image description here

我收到错误消息为“invalid_client”。如何解决这个问题?

谢谢

最佳答案

curl

acme:acmesecret@localhost:9999/uaa/oauth/token
acme:acmesecret是在基本身份验证 header 中发送的 HTTP 客户端凭据。您可以添加 -v切换以查看请求中的 header 。
-d "password=password&username=user&grant_type=password"

这是表格数据。

在 Postman 请求中,您已将其切换。您在表单数据中有客户端凭据,我猜您在 auth header 中有用户凭据。

只需切换它们。对于 OAuth 2.0 密码授予请求,客户端凭据应位于 auth header 中,而用户凭据应位于表单数据中。

关于curl - 如何在 postman 中传递客户端凭据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32276825/

相关文章:

azure 事件目录和 postman

c++ - 如何获得连接路由中的跃点?

php - 如果 CURLOPT_SSL_VERIFYPEER 为假,数据传输是否不再安全?

ruby - 如何为 Ruby 的 RestClient 设置用户代理?

ruby - 限制 rest-client 读取的响应大小

c# - 通过 POSTMAN 发送时 HttpRequest.Files 为空

c# - Azure 移动服务 Active Directory 身份验证 X-ZUMO-AUTH token 在注销后在 postman 中有效

linux - libcurl 不支持 HTTPS

linux - 无法连接到多线程 CURL 中的主机(错误 7)mipsel-linux mipsel 多核架构师

ruby-on-rails - 如何访问这种哈希