Oauth 2.0 keydape JAX-RS和邮递员授权(Auth URL)

Oauth 2.0 keydape JAX-RS和邮递员授权(Auth URL),oauth-2.0,jax-rs,token,postman,keycloak,Oauth 2.0,Jax Rs,Token,Postman,Keycloak,我有jax-rs的资源,并使用keydape 我想和邮递员一起去拿代币 这是jax-rs(keydape快速启动)的数据库客户端 我为邮递员创建了一个客户端 { "realm": "demo", "auth-server-url": "http://localhost:8080/auth", "ssl-required": "external", "resource": "client-postman", "credentials": { "secret": "b53

我有jax-rs的资源,并使用keydape 我想和邮递员一起去拿代币

这是jax-rs(keydape快速启动)的数据库客户端

我为邮递员创建了一个客户端

{
  "realm": "demo",
  "auth-server-url": "http://localhost:8080/auth",
  "ssl-required": "external",
  "resource": "client-postman",
  "credentials": {
    "secret": "b53f32d3-e15b-474b-a88d-1f1cfa68c2dc"
  }
}
我选择了OAuth2.0类型

访问令牌的url为

http://localhost:8080/auth/realms/demo/protocol/openid-connect/token
但是我不知道什么是认证url

我成功地接收到了令牌,但我不知道如何调用jax rs资源

我把它放在钥匙斗篷里:

Direct Access Grants Enabled: ON
Service Accounts Enabled : ON

还有邮递员的要求

现在我有了令牌,我可以通过设置jaxrs url和头文件中的Authorization:bearer[my token]


现在,我想使用Postman的授权功能来加快步骤并直接调用资源,但我不知道是否有可能使用当前版本的Postman和KeyClope
2.2.1。Final
我已经成功地设置了OAuth 2.0

客户机密:不是必需的,但可以在客户机中设置,然后在此处提供

Auth Url:
https://{keydape}/Auth/realms/{REALM}/protocol/openid connect/Auth

令牌Url:
https://{keydove}/auth/realms/{REALM}/protocol/openid connect/Token

您可以从
https://{keydove}/auth/realms/{REALM}/.众所周知的/openid配置

谢谢,但我知道如何通过代码获取令牌,我不知道如何通过postmanThe进行操作。我链接到的帖子使用
curl
解释了它,但这是相同的想法。要呼叫您的服务,您需要一个
授权
标题。别忘了
承载
部分。当我试图获取令牌时,我得到它{“error”:“invalid_client”,“error_description”:“client required user approve”}只需禁用它所需的同意:offThank@stdunbar所有内容都可以完美地与url和postman一起工作,但您知道将其插入postman中的令牌请求的身份验证url,以便加快速度up@ShubhamJain我不理解这个问题,我的应用程序是从密钥时钟获取身份验证令牌。。因为邮递员不允许导入额外的包,所以我在邮递员测试中无法登录。。你如何处理这种情况Hi@Pako。。我提出了一个关于同样的问题。。请检查并让我知道您是否有任何解决方法。。高明的回答。工作起来很有魅力!以防万一,这对任何人都有帮助。在我的例子中,我还需要提供一个范围,但我的领域配置可能会有所不同。
Direct Access Grants Enabled: ON
Service Accounts Enabled : ON