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

Use Keycloak devservice for OIDC MTLS authentication #43565

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

sberyozkin
Copy link
Member

@sberyozkin sberyozkin commented Sep 27, 2024

Currently, integration-tests/oidc uses a custom test factory which launches Keycloak, with the main reason being that Keycloak dev service can not support Keycloak MTLS authentication.

But in fact very little has to be changed in the Keycloak dev service code to get started with MTLS, it already supports arbitrary resource mappings and also custom start commands. The only initial thing I had to do was to get the mapped HTTPS port, when HTTPS is required. Right now I did not even introduce another property like httpsRequired, if the start command has anything related to --https, HTTPS must be supported. A bit more work will be needed to make it work for shared containers later.

I also had to add Tls helper to KeycloakTestClient for tests which require (m)TLS be able to pass keystore resource names to it. I used a record first, but it makes it difficult just to do new Tls() and gets its properties defaulted to some values.

Also converted test keystore resource to .p12, was not really necessary, but it is worth moving to p12 even in tests, as Clement would agree.

I decided to go with this PR to simplify testing OIDC MTLS binding PR which is also in progress

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.

LGTM

@sberyozkin
Copy link
Member Author

Forgot to mention I also updated KeycloakTestClient to support retrieving refresh tokens only, as one of the integration-tests/oidc tests requires it

This comment has been minimized.

@sberyozkin sberyozkin force-pushed the oidc_test_with_dev_service branch from f1565b5 to 110e606 Compare September 27, 2024 15:02
@gastaldi
Copy link
Contributor

Looks good, feel free to merge when CI is done

@gastaldi gastaldi added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Sep 27, 2024
@sberyozkin
Copy link
Member Author

Thanks @gastaldi, applied the suggestion, one last run

@sberyozkin sberyozkin force-pushed the oidc_test_with_dev_service branch from 08b2f9c to b28fbb7 Compare September 27, 2024 15:37
Copy link

quarkus-bot bot commented Sep 27, 2024

Status for workflow Quarkus CI

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

✅ 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.

You can consult the Develocity build scans.

@sberyozkin sberyozkin merged commit 1ff7c69 into quarkusio:main Sep 27, 2024
24 checks passed
@sberyozkin sberyozkin deleted the oidc_test_with_dev_service branch September 27, 2024 16:29
@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Sep 27, 2024
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Sep 27, 2024
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.

2 participants