Skip to content

triauth for HarborOIDC

Let your team sign in to Harbor with one approval on their own device, and no Harbor passwords.

  • Code and DevOps
  • Open source
Sign-in through
OpenID Connect bridge
Available in
Every Harbor installation
Set up in
Administration › Configuration › Authentication

About Harbor

Harbor stores and serves your container images and Helm charts from a server you run, scans them for known vulnerabilities, and can sign them. Operations teams use it as the private registry that developers and servers pull from.

Connect Harbor to triauth

Harbor signs people in through the triauth OpenID Connect bridge. Once connected, Harbor's login page shows LOGIN WITH and your domain's name. People on your team click it, type their username, and approve on their own device. Nobody keeps a Harbor password, and when someone leaves, removing their identity records at your domain ends their access to Harbor as well.

How it works

  1. Open oidc.triauth.org and enter your domain. Paste Harbor's redirect address, https://harbor.example.com/c/oidc/callback with your own Harbor address in place of harbor.example.com, and click Connect app. The bridge gives you a client ID and a client secret.

  2. In Harbor, as an administrator, open Administration › Configuration › Authentication, choose OIDC as the auth mode, and fill in the fields below with your domain in place of example.com. Click Test OIDC Server, then Save.

    FieldValue
    OIDC Provider Nameexample.com
    OIDC Endpointhttps://oidc.triauth.org/example.com
    OIDC Client ID and OIDC Client Secretfrom the bridge
    Group Claim Namegroups
    OIDC Admin Groupharbor-admins@example.com, or whichever group should administer Harbor
    OIDC Scopeopenid,profile,email,groups,offline_access
    Verify Certificateon
    Automatic onboardingon, with Username Claim set to preferred_username
  3. Sign out and click LOGIN WITH example.com.

Checkpoint

Harbor's login page shows LOGIN WITH example.com next to the local login. Choosing it opens a page from the bridge that asks for the username, and the person's authenticator asks them to approve. Harbor then creates their account and opens the projects page.

Good to know

  • With automatic onboarding on, everyone with an identity at your domain gets a Harbor account the first time they sign in, named after their username, such as john. To let only one team in, limit the app to a group when you connect it, or set an OIDC Group Filter.
  • The groups published at your domain become Harbor user groups, which you give project roles, and the members of the admin group become Harbor administrators.
  • docker login and helm use the CLI secret from the person's profile instead of a password. Harbor keeps it valid by renewing the sign-in through the bridge. When the person's identity records go away, the secret stops working. A new sign-in to the web interface starts it again.

For the person who connects the app

SettingValue
Redirect addresshttps://<your-harbor>/c/oidc/callback, also shown at the bottom of the authentication page
Where in HarborAdministration › Configuration › Authentication, with the Auth Mode OIDC. Harbor usually allows the switch from its local database to OIDC only while no local users besides the administrator exist
OIDC Endpointthe issuer, https://oidc.triauth.org/<your domain>, from which Harbor reads the discovery document
OIDC Scopecomma-separated. offline_access is what keeps the CLI secret working. Harbor's docs say that when the provider "does not provide a refresh token or the refresh fails, the CLI secret becomes invalid"
Sessionsthe web interface keeps Harbor's own session, set by SESSION_TIMEOUT and usually 60 minutes, and does not ask the bridge again until it ends. The CLI secret is renewed through the bridge at its first use after the bridge's token expires
OIDC Session Logoutoff, since the bridge has no sign-out endpoint

Harbor keeps the client secret, so leave This app can't keep a secret unticked when you connect it on the bridge.

Harbor's Authentication configuration page with Auth Mode set to OIDC and fields for the provider name, endpoint, client ID, client secret, group filter, group claim name, admin group, and scope
Harbor's OIDC settings form, with a scope that includes offline_access. Source: the Harbor documentation, CC BY 4.0.

Harbor's OIDC provider guide explains every field and the onboarding options.

Next steps

All logos and trademarks belong to their respective owners and do not imply affiliation or endorsement of the organization or product by triauth, nor vice versa. The content provided on this page may include information from third-party sources. We do not assume any responsibility for the completeness, correctness, or applicability of the information. You should independently verify any details before relying on them.