Quarkus Rest Client and OAuth2

≡放荡痞女 提交于 2020-08-07 17:42:43

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/60322447/quarkus-rest-client-and-oauth2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!