How to implement a custom authentication mechanism #42090
-
Hi, In my Quarkus application, I am interacting with a legacy service with requires a stateful authentication mechanism (an old-fashioned session ID). The legacy service exposes a login endpoint, which opens a session (returning the session ID) given a JWT token. So far, I have manually implemented this authentication workflow for each API:
Pseudo-code example:
How can I automate my custom authentication workflow? I thought about:
Am I on the right track with any of these solutions? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Doing a custom May be you can push this state id acquisition to the container request filter and then access the prepared state id in the endpoint method ? See #41770 for a general idea of how it might be done |
Beta Was this translation helpful? Give feedback.
-
After some more experimentation, I am relying on
The Given this identity provider implementation, I can annotate my endpoints with
using it to retrieve the state ID, stored as a credential:
|
Beta Was this translation helpful? Give feedback.
Hi @danilopiazza
Doing a custom
HttpAuthenticationMechanism
would give you more flexibility, though the authentication is really about securing an access todoSomething
, while your task is to facilitate an access to theAwesomeService
via an intermediate state id acquisition.May be you can push this state id acquisition to the container request filter and then access the prepared state id in the endpoint method ? See #41770 for a general idea of how it might be done