我有一个安全的微服务,正在调用另一个安全的微服务.两种服务在Keycloak中都有服务帐户.调用第二项服务时,如何配置第一项服务以自动从密钥斗篷获取访问令牌?这是服务通信的简单服务. Quarkus Rest客户端是否具有执行此操作的API?如果没有,我该如何使用vert.x rest客户端?
I have a secured micro service that is calling another secured micro service. Both services have service accounts in Keycloak. How can I configure the 1st service to automatically obtain access token from keycloak when calling the 2nd service? It's a simple service to service communication. Does the Quarkus Rest client have an API to do this? If not, how can I do that with the vert.x rest client?
推荐答案我能够通过扩展javax.ws.rs.client.ClientRequestFilter来完成这项工作.不幸的是,为了管理请求之间的访问令牌,我不得不编写自己的OAuth2逻辑.我希望将来Quarkus可以提供org.springframework.security.oauth2.client.OAuth2RestTemplate的替代方案
I was able to make this work by extending the javax.ws.rs.client.ClientRequestFilter. Unfortunately I had to write my own OAuth2 logic in order to manage the access token between the requests. I hope that in the future Quarkus would provide an alternative to org.springframework.security.oauth2.client.OAuth2RestTemplate
更多推荐
Quarkus Rest客户端和OAuth2
发布评论