Skip to content

Conversation

@pendula95
Copy link
Contributor

Fixes #713

@tsegismont tsegismont requested a review from pmlopes March 12, 2025 14:32
@tsegismont
Copy link
Contributor

@pmlopes any chance for you to take a look?

Copy link
Contributor

@tsegismont tsegismont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @pendula95

Is there any possibility to add a test with Keycloak?

Copy link
Contributor Author

@pendula95 pendula95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am 100% confident about this change. Looks like client assertion as client authentication method was missed and previous code would not pass needed tests.
I have tried to work around current code to not introduce breaking changes or new api features but as result there are some maybe unexpected behaviors. It might be helpful to have discussion about this changes.


public OAuth2Options setClientAssertionType(String clientAssertionType) {
this.clientAssertionType = clientAssertionType;
this.useBasicAuthorization = false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a shortcut that might introduce unexpected behaviors for some users

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry but I'm not an expert in that area. Can you elaborate about why this might come unexpected for some users? Especially as it seems you say the current behavior is broken in the other comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 2 ways how to use assertion. Both defined: https://datatracker.ietf.org/doc/html/rfc7521

This PR fixes incorrect implementation for Using Assertions for Client Authentication

As test were missing that would catch this, it was overlooked. This has been fixed by the PR and I am quite familiar with this.
On the other hand most of the code that is present its goal was to facilitate Using Assertions as Authorization Grants which I have limited knowledge. And looking at the test non of them validate the functionality so I am not 100% sure that something was not broken by this PR.

@pendula95 pendula95 marked this pull request as draft May 19, 2025 16:27
Copy link
Contributor

@pmlopes pmlopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR is correct and makes sense. Indeed as @pendula95 noticed, the assertion implementation was not considering client authentication. The original code was mainly focused on the authorization grants, so we could support service accounts (how Google like to call it) and On-Behalf-Of (like how Azure likes to call it).

If I remember correctly the extra null checks where there to ensure a smooth interop with Vert.x Web. If this PR passes the existing + new tests and does not introduce any side-effects/regressions in Vertx-Web, it gets my approval 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow specifying clientId together with clientAssertion/clientAssertionType

3 participants