【问题标题】:how to get access-token from keycloak using postman (authcode flow)如何使用邮递员从 keycloak 获取访问令牌(授权码流)
【发布时间】:2020-01-19 00:54:32
【问题描述】:

我正在尝试使用邮递员应用程序从 keycloak 获取访问令牌。我使用的流程是 Auth Code 流程。我给出的 Auth URI 是

http://localhost:8080/auth/realms/realm_name/openid-connect/token

即使在 keycloak 中,我在客户端下的 Security-admin-console 中将有效重定向 URI 更改为 http://localhost:8080/*,但仍然收到一个网页,说明我们很抱歉,而不是在点击获取请求令牌时登录页面邮递员应用程序中的按钮

谁能帮我解决这个问题

【问题讨论】:

  • 正确的网址是https://AUTH_DOMAIN/auth/realms/REALM_NAME/protocol/openid-connect/token

标签: postman access-token keycloak openid-connect


【解决方案1】:

在 Postman 中获取 accessToken:

发布http://localhost:8080/auth/realms/realm-name/protocol/openid-connect/token

标题:

内容类型:application/x-www-form-urlencoded

正文 x-www-form-urlencoded:

client_id: 你的客户

用户名:你正在使用的用户

密码:用户密码

grant_type: 密码

client_secret:11112222-3333-4444-5555-666666666666(如果客户端“访问类型”=“机密”,则需要客户端密码)

在 Postman 中获取 refreshToken:

发布http://localhost:8080/auth/realms/realm-name/protocol/openid-connect/token

标题:

内容类型:application/x-www-form-urlencoded

正文 x-www-form-urlencoded:

client_id: 你的客户

grant_type: refresh_token

refresh_token:从上一个请求刷新令牌

client_secret:11112222-3333-4444-5555-666666666666(如果客户端“访问类型”=“机密”,则需要客户端密码)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-08-16
    • 1970-01-01
    • 1970-01-01
    • 2018-06-13
    • 1970-01-01
    • 2018-12-07
    • 2019-07-22
    相关资源
    最近更新 更多