我有 jax-rs 的资源并使用 keycloak 我想通过 Postman 获取 token
这是 jax-rs (keycloak-quickstart) 的数据库客户端
{
"realm": "demo",
"bearer-only": true,
"auth-server-url": "http://localhost:8080/auth",
"ssl-required": "external",
"resource": "database-service"
}
我为 Postman 创建了一个客户端
{
"realm": "demo",
"auth-server-url": "http://localhost:8080/auth",
"ssl-required": "external",
"resource": "client-postman",
"credentials": {
"secret": "b53f32d3-e15b-474b-a88d-1f1cfa68c2dc"
}
}
访问 token 的 URL 是
http://localhost:8080/auth/realms/demo/protocol/openid-connect/token
最佳答案
使用当前版本的 Postman 和 keycloak 2.2.1.Final
我已成功设置 OAuth 2.0
客户端 key :不是必需的,但据我所知,您可以在客户端中设置它,然后您必须在此处提供它
身份验证网址:https://{KEYCLOAK}/auth/realms/{REALM}/protocol/openid-connect/auth
token 网址:https://{KEYCLOAK}/auth/realms/{REALM}/protocol/openid-connect/token
您可以从以下位置获取这些网址
https://{KEYCLOAK}/auth/realms/{REALM}/.well-known/openid-configuration
关于oauth-2.0 - Keycloak JAX-RS 和 Postman 授权(Auth URL),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45841479/