8000 Allow realm-level override of the CIBA HTTP authentication channel URI by thomasdarimont · Pull Request #54985 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Allow realm-level override of the CIBA HTTP authentication channel URI - #54985

Open
thomasdarimont wants to merge 2 commits into
keycloak:mainfrom
thomasdarimont:issue/gh-54984-ciba-authchannel-override
Open

thomasdarimont wants to merge 2 commits into
keycloak:mainfrom
thomasdarimont:issue/gh-54984-ciba-authchannel-override

Conversation

@thomasdarimont
Copy link
Copy Markdown
Contributor

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

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>
@thomasdarimont
Copy link
Copy Markdown
Contributor Author
Image

New allow-realm-override option (defaults to false) for the ciba-http-auth-channel provider

  • CLI: --spi-ciba-auth-channel--ciba-http-auth-channel--allow-realm-override=true
  • Env: KC_SPI_CIBA_AUTH_CHANNEL__CIBA_HTTP_AUTH_CHANNEL__ALLOW_REALM_OVERRIDE=true

@thomasdarimont
thomasdarimont marked this pull request as ready for review November 10, 2026 14:39
@thomasdarimont
thomasdarimont requested review from a team as code owners November 10, 2026 14:39
Copilot AI balanced review requested due to automatic review settings November 10, 2026 14:39
Copilot AI 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.

🟡 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>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 15:31
Copilot AI 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.

🟢 Approval recommended

No active review issues block approval of the per-realm CIBA endpoint change.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

8000

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.

Allow realm-level override of the CIBA HTTP authentication channel URI

2 pa 3E54 rticipants

0