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

Enhance KeycloakTestClient to support a client_credentials grant #29969

Merged

Conversation

sberyozkin
Copy link
Member

@sberyozkin sberyozkin commented Dec 19, 2022

Fixes #29933.

This PR adds 4 getClientAccessToken methods making it easy to get the access token using a client_credentials grant from a default realm set up by DevServices for Keycloak, and 4 getRealmClientAccessToken to do the same but also letting users set a realm name as one of the method parameters.
The same pattern is used with the existing getAccessToken/getRealmAccessToken methods where a password grant is used.
Also tried to improve the description of how various properties are set.
Update OidcTokenPropagationTest - in the existing test the propagated token contains an alice name because the token was acquired using a password grant. A new test method acquires a token using a client_credentials grant for a quarkus-app client, Keycloak represents it as a service-account-quarkus-app in the token issued using client_credentials grant

CC @pedroigor

@quarkus-bot
Copy link

quarkus-bot bot commented Dec 19, 2022

Failing Jobs - Building e8f33b3

Status Name Step Failures Logs Raw logs
✔️ JVM Tests - JDK 11
✔️ JVM Tests - JDK 17
JVM Tests - JDK 17 MacOS M1 Set up runner ⚠️ Check → Logs Raw logs
✔️ JVM Tests - JDK 18

@geoand geoand merged commit 6b36df2 into quarkusio:main Dec 20, 2022
@quarkus-bot quarkus-bot bot added this to the 2.16 - main milestone Dec 20, 2022
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Dec 20, 2022
@gsmet gsmet modified the milestones: 2.16 - main, 2.15.1.Final Dec 20, 2022
@gsmet gsmet modified the milestones: 2.15.1.Final, 2.16 - main Dec 20, 2022
@gsmet
Copy link
Member

gsmet commented Dec 20, 2022

Not backporting because based on work that is not marked for backport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeycloakTestClient does not supports grant_type = client_credentials
4 participants