Repository navigation
Allow realm-level override of the CIBA HTTP authentication channel URI - #54985
Open
thomasdarimont wants to merge 2 commits into
Open
thomasdarimont wants to merge 2 commits into
thomasdarimont wants to merge 2 commits into
Conversation
Realm admins can set the CIBA authentication channel URI per realm (realm attribute cibaHttpAuthenticationChannelUri, CIBA Policy tab), overriding the server-wide httpAuthenticationChannelUri of the ciba-http-auth-channel provider. The override is only honoured when the server enables --spi-ciba-auth-channel--ciba-http-auth-channel--allow-realm-override=true (default false), as the channel receives a token that can complete CIBA authentication for the requested user. The URI must be an absolute http(s) URI and is validated on realm update. Fixes keycloak#54984 Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
Contributor
Author
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Mixed-case HTTPS schemes pass validation but fail at runtime, and Reload leaves an unsaved CIBA URI in the form when the realm attribute is unset, risking unintended persistence on a later Save.
2 open issues
What changed in this PR
Adds a per-realm CIBA HTTP authentication channel URI for multi-tenant device integrations, gated by a server option that defaults to disabled.
Changes:
- Adds realm-specific URI resolution, server fallback, and validation on realm updates.
- Exposes the setting in the admin console and documents its security implications.
- Adds unit and integration coverage for URI selection and validation.
| File | Description |
|---|---|
tests/base/src/test/java/org/keycloak/tests/oauth/CibaRealmAuthenticationChannelUriTest.java |
Tests realm overrides, fallback, and invalid URI rejection. |
services/src/test/java/org/keycloak/protocol/oidc/grants/ciba/channel/HttpAuthenticationChannelProviderTest.java |
Tests URI resolution and validation helpers. |
services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java |
Validates channel URIs on realm updates. |
services/src/main/java/org/keycloak/protocol/oidc/grants/ciba/channel/HttpAuthenticationChannelProviderFactory.java |
Adds the default-disabled override option. |
services/src/main/java/org/keycloak/protocol/oidc/grants/ciba/channel/HttpAuthenticationChannelProvider.java |
Resolves realm overrides and warns when disabled. |
server-spi/src/main/java/org/keycloak/models/CibaConfig.java |
Defines the realm attribute constant. |
js/apps/admin-ui/src/authentication/policies/CibaPolicy.tsx |
Adds the channel URI field and client-side validation. |
js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties |
Adds field labels, help text, and validation messaging. |
docs/documentation/server_admin/topics/sso-protocols/con-oidc-auth-flows.adoc |
Documents configuration and the security gate. |
Review effort: Balanced
- Use the same URI validation at runtime as on realm update, so mixed-case schemes like HTTPS:// no longer pass validation but fail CIBA requests. - Reset the optional channel URI field on Reload in the CIBA policy form, so a discarded value is not saved later. Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Realm admins can set the CIBA authentication channel URI per realm (realm attribute cibaHttpAuthenticationChannelUri, CIBA Policy tab), overriding the server-wide httpAuthenticationChannelUri of the ciba-http-auth-channel provider.
The override is only honoured when the server enables --spi-ciba-auth-channel--ciba-http-auth-channel--allow-realm-override=true (default false), as the channel receives a token that can complete CIBA authentication for the requested user. The URI must be an absolute http(s) URI and is validated on realm update.
Fixes #54984