Skip to content
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

Simplify the way OIDC tenant id interceptors can be created #34706

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

sberyozkin
Copy link
Member

@sberyozkin sberyozkin commented Jul 12, 2023

Fixes #34692.

This PR simplifies the way custom tenant resolver interceptors can be created, now one just has to extend quarkus.oidc.TenantResolverInterceptor and pass it the tenant id.

Update the test to confirm the hr tenant configuration is picked up - this configuration adds a custom audience value - which causes 401 when the test uses a token with another (default) audience but adding an audience expected by the hr tenant fixes it.

This option complements 2 other options, where either TenantResolver or TenantConfigResolver can be used

@sberyozkin sberyozkin requested review from gastaldi and pedroigor July 12, 2023 14:50
Copy link
Contributor

@gastaldi gastaldi left a comment

Choose a reason for hiding this comment

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

Looks better to me. Using a getter improves code readability, as it's not always trivial to figure out what goes in the constructor

@sberyozkin
Copy link
Member Author

@gastaldi

Using a getter improves code readability, as it's not always trivial to figure out what goes in the constructor

I've noticed it immediately after I tried it, thanks for moving me in this direction :-)

@gastaldi
Copy link
Contributor

Don't forget to squash everything before it gets merged

@sberyozkin sberyozkin force-pushed the tenant_resolver_annotation branch from b36f073 to 7841f07 Compare July 12, 2023 16:11
@github-actions
Copy link

github-actions bot commented Jul 12, 2023

🙈 The PR is closed and the preview is expired.

@gastaldi gastaldi merged commit ec6e50a into quarkusio:main Jul 12, 2023
@quarkus-bot quarkus-bot bot added this to the 3.3 - main milestone Jul 12, 2023
@sberyozkin sberyozkin deleted the tenant_resolver_annotation branch July 12, 2023 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Selecting OIDC tenant via annotation is not working with RESTEasy Reactive
2 participants