[Fix #952] Refactoring auth code#975
Conversation
Signed-off-by: fjtirado <ftirados@redhat.com>
c46fe9b to
2356235
Compare
| import java.util.Map; | ||
| import java.util.ServiceLoader; | ||
|
|
||
| public class AccessTokenProvider { |
There was a problem hiding this comment.
Can we replace this provider in the extension? For this feature, we will be using the Quarkus OIDC Client, which we will likely be using.
There was a problem hiding this comment.
The Provider suffix here is kind of misleading, but I keep the original because lack of better alternative (Im terrible with naming). This class is just an aggregation of the info that is needed to perform the call, using JaxRS, to retrieve the token.
If in future we use Quarkus OIDC client, probably it will be better to write a new HTTP task (which can be done, base on the quarkus stack, in the quarkus extension)
| import java.util.Map; | ||
|
|
||
| public class OAuthRequestBuilder extends AbstractAuthRequestBuilder { | ||
| public class OAuthRequestBuilder |
There was a problem hiding this comment.
We may even consider this lightweight dep: https://www.pac4j.org/docs/clients/openid-connect.html (maybe as an optional library impl-http-oidc)
There was a problem hiding this comment.
There is not need to add the dependency right now, the call to retrieve the token is based on JaxRS and seems to be working fine.
There was a problem hiding this comment.
But the role OIDC API is complex to implement, have we already done it? cc @treblereel
There was a problem hiding this comment.
But its not in the spec schema, isnt it?
There was a problem hiding this comment.
To acquire the token, you need to come back and forth the token server.
The specification includes the scheme to control the endpoints where you'd get the token:
https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#oauth2-authentication
There was a problem hiding this comment.
yes, this partially implemented, I will open PR for completion
Signed-off-by: fjtirado <ftirados@redhat.com>
Fix #952