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

Updating selected OIDC/OpenID guides #42846

Merged
merged 3 commits into from
Aug 29, 2024

Conversation

jedla97
Copy link
Contributor

@jedla97 jedla97 commented Aug 28, 2024

Updating and fixing some small things like misspell, missing imports, not working code out of the box and others.

@quarkus-bot quarkus-bot bot added area/docstyle issues related for manual docstyle review area/documentation labels Aug 28, 2024
Copy link

github-actions bot commented Aug 28, 2024

🙈 The PR is closed and the preview is expired.

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@@ -191,7 +192,7 @@ public class CustomTenantResolver implements TenantConfigResolver {
config.setApplicationType(ApplicationType.HYBRID);
return Uni.createFrom().item(config);
} else {
// resolve to default tenant config
context.put(OidcUtils.TENANT_ID_ATTRIBUTE, OidcUtils.DEFAULT_TENANT_ID);
Copy link
Member

Choose a reason for hiding this comment

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

@jedla97 Custom resolvers are not required to set the default tenant id manually, returning null is enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sberyozkin as this is guide with quickstart the code should be same as close as possible. So I looked in quickstart and see it there https://github.com/quarkusio/quarkus-quickstarts/blob/main/security-openid-connect-multi-tenancy-quickstart/src/main/java/org/acme/quickstart/oidc/CustomTenantResolver.java#L34

Also the quickstart test was failing for me without this. I now find why and also see that in test section the coverage is outdated from quickstart. I'll look into that.

Copy link
Member

@sberyozkin sberyozkin Aug 29, 2024

Choose a reason for hiding this comment

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

@jedla97 I'd not worry about it, I think it is there to support a test where the user switches between multiple realms while being already logged into one of them. It is not something that we should recommend, manually deal with setting the default property by default.
This specific case is covered at the very end of https://quarkus.io/guides/security-openid-connect-multitenancy#tenant-resolution-for-web-app

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sberyozkin Ok I'll leave it as it is now.

@@ -209,8 +210,10 @@ Otherwise, it initiates an authorization code flow when authentication is requir
[source,properties]
----
# Default tenant configuration
%prod.quarkus.oidc.auth-server-url=http://localhost:8180/realms/quarkus
%prod.keycloak.url=http://localhost:8180
Copy link
Member

Choose a reason for hiding this comment

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

Why can't a single property be used ? It looks more complex now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I change it to be cloaser to quickstart but when I think about it let's leave it as %prod.quarkus.oidc.auth-server-url=http://localhost:8180/realms/quarkus

Copy link
Member

@sberyozkin sberyozkin left a comment

Choose a reason for hiding this comment

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

Hi @jedla97 Thanks for the careful review, I have a couple of questions, but otherwise LGTM

@@ -233,13 +235,16 @@ Alternatively, you can configure the tenant `tenant-a` directly in `application.
[source,properties]
----
# Default tenant configuration
%prod.quarkus.oidc.auth-server-url=http://localhost:8180/realms/quarkus
%prod.keycloak.url=http://localhost:8180
Copy link
Member

Choose a reason for hiding this comment

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

@jedla97 Please keep a single property here too

Copy link
Member

Choose a reason for hiding this comment

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

@jedla97 In general, we'd like to avoid highlighting Keycloak may be involved as there is still some perception that quarkus-oidc is for Keycloak users only

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@jedla97 In general, we'd like to avoid highlighting Keycloak may be involved as there is still some perception that quarkus-oidc is for Keycloak users only

Thanks I didn't know that

@quarkus-bot

This comment has been minimized.

@quarkus-bot
Copy link

quarkus-bot bot commented Aug 29, 2024

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit b655d52.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Copy link
Member

@sberyozkin sberyozkin left a comment

Choose a reason for hiding this comment

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

Thanks @jedla97 for trying to make security docs perfect :-)

@sberyozkin sberyozkin merged commit d476da6 into quarkusio:main Aug 29, 2024
5 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Aug 29, 2024
@gsmet gsmet modified the milestones: 3.16 - main, 3.14.2 Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docstyle issues related for manual docstyle review area/documentation
Projects
Development

Successfully merging this pull request may close these issues.

3 participants