Quarkus Rest客户端和OAuth2

编程入门 行业动态 更新时间:2024-10-17 09:38:36
本文介绍了Quarkus Rest客户端和OAuth2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个安全的微服务,正在调用另一个安全的微服务.两种服务在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

本文发布于:2023-11-07 15:23:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566810.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   Quarkus   Rest

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!