Run:ai Keycloak SSO Authentication Setup
Configure Run:ai SSO authentication with Keycloak on OpenShift: OIDC integration, user federation, role mapping, and troubleshooting login failures.
π‘ Quick Answer: Run:ai uses Keycloak for SSO authentication, supporting OIDC/SAML with corporate IdPs. The login page at
https://runai.apps.example.comredirects to Keycloak, which handles user federation (LDAP/AD), role mapping (admin/researcher/viewer), and token issuance.
The Problem
You need to:
- Enable SSO for Run:ai so users authenticate via corporate identity provider
- Map IdP groups to Run:ai roles (admin, researcher, viewer)
- Troubleshoot βCONTINUE WITH SSOβ login failures
- Configure Keycloak realm and client for Run:ai
The Solution
Run:ai Login Flow
User β Run:ai UI (https://runai.apps.example.com)
β Keycloak Login Page (Email/Password or "CONTINUE WITH SSO")
β Corporate IdP (SAML/OIDC)
β Token issued β Redirect back to Run:ai UI
β API calls with Bearer tokenKeycloak Realm Configuration
# Run:ai creates a realm called "runai"
realm: runai
enabled: true
sslRequired: external
registrationAllowed: false
clients:
- clientId: runai-frontend
protocol: openid-connect
publicClient: true
redirectUris:
- "https://runai.apps.example.com/*"
webOrigins:
- "https://runai.apps.example.com"
- clientId: runai-cli
protocol: openid-connect
publicClient: true
directAccessGrantsEnabled: true # For CLI token authCorporate IdP Integration (OIDC)
# Identity Provider configuration in Keycloak
identityProviders:
- alias: corporate-sso
providerId: oidc
enabled: true
config:
authorizationUrl: "https://login.corp.example.com/oauth2/authorize"
tokenUrl: "https://login.corp.example.com/oauth2/token"
clientId: "runai-keycloak"
clientSecret: "${CORPORATE_OIDC_SECRET}"
defaultScope: "openid profile email groups"
syncMode: IMPORTRole Mapping
Run:ai roles:
βββ Platform Admin β Full cluster access, manage projects/quotas
βββ Department Admin β Manage specific department resources
βββ Researcher β Submit/view own workloads
βββ Viewer β Read-only access to dashboards
βββ ML Engineer β Submit workloads + view metrics
Keycloak group β Run:ai role mapping:
cn=gpu-admins,ou=groups β Platform Admin
cn=ml-team,ou=groups β Researcher
cn=viewers,ou=groups β ViewerLogin Page Assets
Run:ai login page resources (all 200 OK):
βββ auth?response_type=code&connection=runai&client... (document)
βββ patternfly.min.css (stylesheet)
βββ patternfly-additions.min.css (stylesheet)
βββ pficon.css (stylesheet)
βββ nv-login.css (stylesheet)
βββ menu-button-links.js (script)
βββ authChecker.js (script)
βββ data:image/svg+xml (inline logo) (svg+xml)
βββ bg-login.jpg (background)
βββ nvidia-login-logo.svg (logo)
βββ Roboto-Regular.ttf (font)
Total: 12 requests, 11.6 kB transferred, 2.1 MB resources
Finish: 134 ms, DOMContentLoaded: 121 ms, Load: 225 msVerify Keycloak Health
# Check Keycloak Pod
oc get pods -n runai-backend -l app=keycloak
# Check Keycloak logs
oc logs -n runai-backend -l app=keycloak --tail=50
# Test Keycloak endpoint
curl -sk https://runai.apps.example.com/auth/realms/runai/.well-known/openid-configuration | jq .issuer
# Check Keycloak admin console
# https://runai.apps.example.com/auth/admin/runai/consoleCLI Authentication
# Login via CLI (uses device code flow)
runai login
# Or with direct credentials
runai login --user researcher@example.com --password <password>
# Check current auth
runai whoami
# Token stored at ~/.runai/config
cat ~/.runai/config | jq .tokenCommon Issues
βCONTINUE WITH SSOβ button does nothing
- Cause: IdP metadata URL unreachable from Keycloak Pod
- Fix: Check network policies; verify IdP URL accessible from runai-backend namespace
Login redirects to blank page
- Cause: Redirect URI mismatch in Keycloak client config
- Fix: Add exact redirect URI including trailing slash
Token expired errors in CLI
- Cause: Access token TTL too short (default 5min)
- Fix: Increase token lifespan in Keycloak realm settings (15-30 min)
Users canβt see their workloads
- Cause: Role mapping not applied correctly
- Fix: Check Keycloak group membership; verify role binding in Run:ai
Best Practices
- Use SSO exclusively β disable local admin password after initial setup
- Map groups not users β easier to manage at scale
- Set token TTL to 15 min β balance security vs user experience
- Enable MFA in corporate IdP β Keycloak passes through MFA requirements
- Monitor login failures β Keycloak events log shows failed attempts
- Backup Keycloak DB β realm config is stored in PostgreSQL
Key Takeaways
- Run:ai login page uses NVIDIA-branded Keycloak theme (PatternFly CSS)
- Two auth methods: local (email/password) and SSO (corporate IdP)
- Keycloak handles OIDC/SAML federation, group sync, and token issuance
- Role mapping: IdP groups β Keycloak groups β Run:ai roles
- CLI uses device code flow or direct access grants
- Login page loads in 225ms (12 requests, 2.1MB) β lightweight
- All auth state lives in PostgreSQL (part of runai-backend)

Recommended
Kubernetes Recipes β The Complete Book100+ production-ready patterns with detailed explanations, best practices, and copy-paste YAML. Everything in one place.
Get the Book βLearn by Doing
CopyPasteLearn β Hands-on Cloud & DevOps CoursesMaster Kubernetes, Ansible, Terraform, and MLOps with interactive, copy-paste-run lessons. Start free.
Browse Courses βπ Deepen Your Skills β Hands-on Courses
Courses by CopyPasteLearn.com β Learn IT by Doing
