8000 fix: allowing the kubernetes jwt test to pass on openshift (#49488) by shawkins · Pull Request #49614 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

fix: allowing the kubernetes jwt test to pass on openshift (#49488) - #49614

Merged
ahus1 merged 2 commits into
keycloak:release/26.6from
shawkins:backport-49488-26.6
Jun 29, 2026
Merged

ahus1 merged 2 commits into
keycloak:release/26.6from
shawkins:backport-49488-26.6

Conversation

@shawkins
@shawkins shawkins commented Jun 2, 2026
Copy link
Copy Markdown
Contributor

closes: #49445

Signed-off-by: Steve Hawkins shawkins@redhat.com
(cherry picked from commit 2e79884)

@shawkins
shawkins commented Jun 2, 2026
Copy link
Copy Markdown
Contributor Author

@vmuzikar It appears that the request can no longer contain the client_id against minishift in the backport. At first glance there doesn't appear to be differences in the org.keycloak.broker.kubernetes package or the operator-ci kube / minikube version to explain this.

@michalvavrik michalvavrik left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@vmuzikar
vmuzikar commented Jun 4, 2026
Copy link
Copy Markdown
Contributor

@vmuzikar It appears that the request can no longer contain the client_id against minishift in the backport. At first glance there doesn't appear to be differences in the org.keycloak.broker.kubernetes package or the operator-ci kube / minikube version to explain this.

@slaskawi Is this expected?

@Pepo48 Pepo48 left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks Steve!

@shawkins
shawkins force-pushed the backport-49488-26.6 branch from bdfa1ff to 89788df Compare June 4, 2026 23:41
};
));
if (Utils.isOpenShift(k8sclient)) {
args.addAll(List.of("--data-urlencode", "client_id=kubernetes-client")); // the token may not contain the client
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unfortunately I don't have an OpenShift cluster at hand but I wonder if we really need it?

When using the "Signed JWT - Federated authentication", Keycloak selects an IdP and Client pair based on the JWT token (using the DefaultClientAssertionStrategy). The client_id param is not actively in the authentication process.

With the latest changes from #48026, when the client_id is passed in - it's validated.

Also related to this, @chance-coleman works on an inprovement of the Issuer discovery process: #49600. Since OpenShift uses Osin internally, it probably falls into the same category as other managed clusters (AKS/EKS). This improvement could help in this case as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately I don't have an OpenShift cluster at hand but I wonder if we really need it?

This could have to do with the order in which I fixed things. Initially with openshift the server side error was client_not_found, so I added the client_id (because it did appear in the minikube token, but not the openshift one). Things still failed, but that was because the openshift issuer is different than the minikube one. After that change, things seemed to work for both openshift and minikube.

I will spin up another openshift to see if it works with just the issuer fix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@slaskawi @vmuzikar everything works without the client_id in the request - so that was an initial red herring. I'll apply this second commit to master as well to keep things in sync.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fantasic! Thank you for looking into this @shawkins !

@shawkins
shawkins force-pushed the backport-49488-26.6 branch 3 times, most recently from 58bd981 to d45dc2a Compare June 5, 2026 14:25
@slaskawi slaskawi left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@vmuzikar
vmuzikar force-pushed the backport-49488-26.6 branch from d45dc2a to c14c8ab Compare June 8, 2026 07:06
@vmuzikar
vmuzikar enabled auto-merge (squash) June 8, 2026 07:06
shawkins added 2 commits June 10, 2026 07:49
…49488)

closes: keycloak#49445

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
(cherry picked from commit 2e79884)
closes: keycloak#49445

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
@shawkins
shawkins force-pushed the backport-49488-26.6 branch from c14c8ab to 845327f Compare June 10, 2026 11:49
@shawkins
shawkins disabled auto-merge June 11, 2026 11:12
@shawkins
shawkins enabled auto-merge (squash) June 11, 2026 11:16
@vmuzikar
vmuzikar disabled auto-merge June 17, 2026 15:04
@vmuzikar
vmuzikar enabled auto-merge (squash) June 17, 2026 15:04
@ahus1
ahus1 disabled auto-merge June 29, 2026 11:55
@ahus1
ahus1 merged commit 3cb44d9 into keycloak:release/26.6 Jun 29, 2026
81 checks passed
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.

6 participants

0