Harbor SSO with Keycloak (OIDC)
Use Keycloak for browser login to Harbor; OIDC users use a Harbor CLI secret for Docker or Helm rather than their Keycloak password.
Last updated
On this page (5)
Harbor · Keycloak · OIDC
Before you start
- Harbor deployment eligible to change authentication mode (no local users other than admin when switching from database mode).
- HTTPS Keycloak realm and Harbor endpoints.
Configure sign-in
- Create a confidential Standard Flow client and register the exact OIDC redirect URI shown by Harbor.
- In Harbor Administration > Configuration > Authentication, choose OIDC, enter the realm issuer and client credentials, and keep certificate verification enabled.
- If using automatic onboarding, select a username claim actually present in the ID token, such as preferred_username after checking it. Otherwise let users choose a Harbor username on first login.
- If assigning registry permissions through groups, emit a dedicated group claim in the ID token, set Harbor’s groups claim and use the exact emitted value for the single optional OIDC Admin Group. Assign project roles separately.
Verify the result
- Test connection, first login, and entitlement boundaries using administrator and regular users.
- Test a registry pull with a Harbor CLI secret, and check its refresh behavior according to the provider’s refresh-token policy.
