Guide: Microsoft Entra SSO integration with Harbor
This guide provides instructions on how to configure Harbor with OpenID Connect (OIDC) authentication using Microsoft Entra as the Identity Provider (IdP).
Prerequisitesβ
- Access to the Microsoft Entra Admin Center with administrative privileges.
- Created Microsoft Entra Tenant.
- Installed Harbor.
Configuring Microsoft Entra Applicationβ
To configure Microsoft Entra as the Identity Provider for Harbor, it is necessary to create and configure an Application in the Microsoft Entra Admin Center.
-
Log in to the Microsoft Entra Admin Center.
-
In the left sidebar menu, select Applications and click App registrations.
-
Click on the New registration button.
-
Fill in the required fields, such as Name, Supported account types and Redirect URI. Click Register to create the application.
noteThe Redirect URI should be in the format
https://<Harbor URL>/c/oidc/callback
. -
Navigate to the Certificates & secrets section from the left sidebar menu. In the Client secrets tab, click on the New client secret button to create a new secret. Fill in the required fields and click Add.
-
Copy the generated Client secret value and store it securely.
-
Navigate to the Token configuration section and click on Add groups claim button. Choose the group type as Security Groups and for the ID token type, select Group ID.
-
Navigate to the API permissions section. Click on the Add a permission button. Select Microsoft Graph and then Delegated permissions. Add the following permissions:
- openid
- profile
- User.Read
After adding the permissions, click on the Grant admin consent for 'Tenant name' button to grant the required permissions.
After configuring the Microsoft Entra Application, you can proceed with the Harbor configuration.
Creating the Groupsβ
To manage access to Harbor, it is necessary to create the groups in Microsoft Entra and assign users to it.
-
In the Microsoft Entra Admin Center, in the left sidebar menu, select Groups and then All groups. Click on New group button to create a new group(s) for users who will have access to Harbor (e.g.,
administrator
). -
Fill in the required fields, such as Groups type and Group name. In the Members section, add users who will have access to SonarQube.
-
After adding the necessary members, review the group settings and click Create to save the group.
Configuring Harborβ
To integrate Harbor with the configured Microsoft Entra application, it is necessary to configure the OIDC parameters directly in Harbor.
The Application data, such as Application (client) ID and Directory (tenant) ID, can be found in the Overview section of the Application in the Microsoft Entra Admin Center.
The Object ID can be found in the Overview section of the group in the Microsoft Entra Admin Center.
-
Log in to the Harbor web interface as an administrator.
-
In the left sidebar menu, navigate to Administration tab and click on Configuration section. In the Authentication tab, fill in the required fields for the OIDC configuration:
Replace the following values with the data from the Microsoft Entra Application:
- OIDC Provider Name:
azure
- OIDC Endpoint:
https://login.microsoftonline.com/<Directory (tenant) ID>/v2.0
, where<Directory (tenant) ID>
is the Directory ID of your Microsoft Entra Tenant. - OIDC Client ID: The Application (client) ID of your Microsoft Entra Application.
- OIDC Client Secret: The Client Secret value from the Microsoft Entra Application.
- Group Claim Name:
groups
- OIDC Admin Group: The Object ID of the
administrator
group from the Microsoft Entra Admin Center. - OIDC Scope:
openid,profile,email,offline_access
- OIDC Provider Name:
-
Click on the Test OIDC Server button to verify the configuration. If the test is successful, click on the Save button to apply the changes.
-
Verify that the OIDC authentication is configured correctly by logging in to the Harbor web interface using the Login via OIDC Provider button.
After completing these steps, Harbor is configured to use Microsoft Entra as the Identity Provider for OIDC authentication.