-
Notifications
You must be signed in to change notification settings - Fork 338
Added user token to the PolarisPrincipal #3236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
snazy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be useful.
One minor comment on the change.
polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisPrincipal.java
Outdated
Show resolved
Hide resolved
polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisPrincipal.java
Show resolved
Hide resolved
dimas-b
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this stage it probably requires some custom code in order to put the access token to good use, still, as for me, this feature looks pretty useful to have in Polaris.
|
Note: this change is backward compatible at the java class level, as far as I can tell. |
|
Just re-iterating what I said in #3170: If the goal is really about retrieving the OAuth2 token that was used to authenticate, I think Quarkus OIDC token propagation might be a better approach. In particular, one can inject https://quarkus.io/guides/security-openid-connect-client-reference#inject-tokens But if the goal is more about exposing ALL the principal credentials through the The PR currently suggests |
snazy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cccs-cat001 do you mind elaborating how you intend to use the JWT or specific claims?
I was looking into whether there's a nicer way for consumers to get the whole JWT or specific claims.
I wonder whether we could just get away with CDI injection?
Yea, I was wondering about that as well now, given that re-constructing a JWT requires parsing JSON. |
We're looking for a way to pass the users token along to the STS, like in #3170. Since that was closed due to some concerns over security, I've been given a way to do this in our downstream build. There's another PR open, #3224 which will pass the PolarisPrincipal down to the |
adnanhemani
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a chat with @dimas-b offline. Per my understanding, this is very similar to #3170 but stops short of introducing the behavior that is being pushed back against (doing the credential vending itself) on the ML and PR.
As a result, I am okay with the general changes here - given the baseline that we will NOT be re-introducing the changes from #3170 at any point in the future (unless there is consensus to do so on the existing ML thread).
However, there is one callout that is security-critical issue IMO that we must change to let this code be acceptable still. I don't think the change requires us to change the overall approach (I hope...) but needs to be taken care of prior to merging.
runtime/service/src/main/java/org/apache/polaris/service/auth/DefaultAuthenticator.java
Show resolved
Hide resolved
|
@adutra :
As far as I understand, the goal of this PR is simply to enable custom code to use the token during the authentication flow against STS. As far as I understand, This aspect was discussed briefly in #3224 (as you probably know) and in #3196 (indirectly). If From my POV limiting this PR to the unparsed auth token propagation is probably sufficient for now. However, I would not mind using |
adnanhemani
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as per #3236 (review)
Thanks for this contribution @cccs-cat001!
Adding the user token to the PolarisPrincipal/PolarisCredential to allow for more customized authentication and storage integrations.
Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)