Wire LiteLLM SSO to Authentik (generic OIDC) #268
Reference in New Issue
Block a user
Delete Branch "benvin/litellm-sso"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
App-side of the LiteLLM Authentik onboarding (pairs with terraform-authentik#8). Enables LiteLLM's generic OIDC SSO against Authentik so the UI/admin uses Authentik identity.
Change
oauth-credentials: surfaces the OIDC client secret (the same secret Authentik sets on the litellm provider, keyclient_secret) as a k8s Secret.GENERIC_CLIENT_SECRETinjected from that Secret (reloaderannotation already present → restarts on change).GENERIC_CLIENT_ID, authorization/token/userinfo endpoints (identity.unkin.net, matching argocd/grafana),GENERIC_SCOPE, andPROXY_BASE_URL(required for LiteLLM SSO).Depends on
litellmOAuth2 provider/application).kv/kubernetes/namespace/litellm/default/oauth-credentials(done).Validation
kustomize build apps/base/litellmrenders the env, secret ref, and VaultStaticSecret; pre-commit clean (no plain Secrets).Note
This wires SSO authentication. LiteLLM assigns SSO users the default internal-user role; admin/role provisioning (e.g.
PROXY_ADMIN_IDor group-based roles) is a separate step if needed.Extended beyond authentication: now also requests the
litellm_rolescope and setsGENERIC_USER_ROLE_ATTRIBUTE=litellm_role, so LiteLLM roles follow Authentik groups (pairs with terraform-authentik#10: akP-litellm-admin -> proxy_admin, akP-litellm-user -> internal_user).