0

My quarkus backend is calling a rest web service which requires an access token. The access token is generated using client id, client secret and grant type client credentials. The token is valid for a couple of days. This quarkus backend then propagates the data to an angular frontend. I have a couple of questions:

  1. Is there an out of the box implementation from Quarkus framework?
  2. If not, please guide me if I should use httpclient or any other library for getting the access token.
  3. How to check for refresh token?
  4. How to save the access token, so that it can be used for other requests by other users? Otherwise I end up generating an access token every time a user calls the rest service.

1 Answers1

0

Since there is no answer, I will write here how I implemented this:

  1. I use a java.net.http.httpclient to call the oauth server for getting the token with the client id and secret.
  2. I cache the token using quarkus-cache and when the token expires, the quarkus-cache is invalidated and rebuilt with the new token. Suggestions or better solutions are welcome.