Skip to content

epic: Migrate Kagenti platform from Keycloak master realm to dedicated kagenti realm #767

Closed
3 of 3 issues completed

Description

@mrsabath

Summary

Migrate all Kagenti platform components from the Keycloak master realm (UI/backend) and demo realm (AuthBridge demos) to a single dedicated kagenti realm.

Motivation

The Kagenti UI authenticates users via Keycloak's master realm, while AuthBridge demos use a separate demo realm. This realm mismatch causes UI chat with AuthBridge-protected agents to fail with 401 Unauthorized because the go-processor validates inbound JWTs against the demo realm JWKS, but the UI token is issued by the master realm.

Unifying onto a single kagenti realm resolves this and simplifies the overall authentication architecture.

Related: kagenti-extensions#147

Phases

Phase 1: UI + Backend Realm Migration (kagenti repo)

  • Migrate UI, backend, and Helm templates from master to kagenti realm
  • Add guarded realm bootstrap logic (create realm + default admin user on install)
  • Add email/name fields and realm-admin role to bootstrapped user (Keycloak 26.x compatibility)
  • Create and assign admin realm role for backend RBAC mapping (fixes "Required role: kagenti-operator")
  • PR: kagenti#764

Phase 1b: Fix AuthBridge Inject Label for Tools (kagenti repo)

  • Propagate kagenti.io/inject label to pod template labels in tool deployments (webhook reads pod template labels, not deployment metadata)
  • PR: kagenti#768

Phase 2: Migrate AuthBridge Demos to kagenti Realm (kagenti-extensions repo)

  • Update ConfigMaps, deployment YAMLs, setup_keycloak.py, and demo-manual.md to use kagenti realm instead of demo
  • PR: kagenti-extensions#148

Phase 2b: Migrate demo-ui.md to kagenti Realm (kagenti-extensions repo)

Phase 3: Fix Go-Processor Outbound Token Acquisition (kagenti-extensions repo)

  • Add client_credentials grant fallback when token exchange fails or no auth header is present
  • The go-processor previously only supported RFC 8693 token exchange for outbound requests, which requires a valid subject_token. When agents don't forward inbound tokens, outbound requests reached tools without authentication.
  • PR: kagenti-extensions#152

Phase 4: Migrate CI Pipelines (future)

  • Update CI workflows that reference master realm to use kagenti
  • Deferred to a follow-up effort

Blocking Issues

Issue Repo Description
kagenti-extensions#153 kagenti-extensions Webhook does not mount svid-output volume in envoy-proxy container — go-processor cannot access SPIFFE JWT SVID
agent-examples#129 agent-examples Agent's built-in authlib JWT validation crashes on Keycloak JWKS (RSA-OAEP key) — remove redundant auth when AuthBridge is present

Acceptance Criteria

  • Fresh install: UI login works against kagenti realm
  • Keycloak admin console accessible without permission errors
  • AuthBridge demos work end-to-end with kagenti realm
  • UI chat with AuthBridge-protected agents returns valid responses (after go-processor fix)
  • All changes are idempotent (re-running bootstrap/setup scripts creates no duplicates)

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. moved this from Backlog to In review / Needs Testing in Rossoctl Issue Prioritizationon Mar 9, 2026
  2. mrsabath commented on Mar 9, 2026

    @mrsabath
    MemberAuthor

    Epic Status: All Phases Complete ✓

    All phases of the realm migration are now complete. Summary:

    Phases

    Phase PR Status
    Phase 1: UI + Backend Realm Migration kagenti#764 Merged (Mar 4)
    Phase 1b: Fix AuthBridge Inject Label kagenti#768 Merged (Feb 26)
    Phase 2: Migrate AuthBridge Demos kagenti-extensions#148 → landed via kagenti-extensions#149 Merged (Mar 6)
    Phase 2b: Migrate demo-ui.md kagenti-extensions#149 Merged (Mar 6)
    Phase 3: Go-Processor Outbound Fallback kagenti-extensions#152 → superseded by kagenti-extensions#171 Merged (Mar 6)
    Phase 4: Migrate CI Pipelines Deferred to follow-up effort N/A

    Blocking Issues

    Issue Status
    kagenti-extensions#153 (svid-output volume mount) Closed (Feb 27) — fixed via kagenti-extensions#154
    agent-examples#129 (authlib JWT crash) Closed (Feb 27)

    Cleanup

    Remaining

    Phase 4 (CI pipeline migration) is deferred. All other acceptance criteria are met. Closing this epic.

  3. moved this from In review / Needs Testing to Done in Rossoctl Issue Prioritizationon Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions