Single Sign-On (SSO) with SAML

Updated 1 month ago by Michael Cretzman

Harness supports Single Sign-On (SSO) with SAML, integrating with your SAML SSO provider to enable you to log your users into Harness as part of your SSO infrastructure.

This document explains how to set up SAML authentication and authorization for the following:

SAML SSO with Harness Overview

To set up SAML SSO with Harness, you add a SAML SSO provider to your Harness account, and enable it as the default authentication method.

Harness SAML SSO involves the following:

  • Harness User email addresses - Users are invited to Harness using their email addresses. Once they log into Harness, their email addresses are registered with Harness as Harness Users. To use SAML SSO, Harness Users must use the same email addresses to register in Harness and the SAML provider.
Ensure that you have at least two corresponding user accounts when setting up and testing SAML SSO in Harness. This allows you to set up the account with a Harness Administrator account and test it with a Harness user account.
  • SAML provider user email addresses - To use the SAML provider to verify Harness Users, the email addresses used in the SAML provider must match the email addresses for the registered Harness Users you want to verify.
  • Harness SAML Endpoint URL - This URL is where the SAML provider will post the SAML authentication response to your Harness account. This URL is provided by Harness in the Single Sign-On (SSO) Provider dialog. You enter this URL in your SAML SSO provider app to integrate it with Harness.
  • SAML metadata file - This file is provided by your SAML provider app. You upload this file into the Harness Single Sign-On (SSO) Provider dialog to integrate the app with Harness.

Using Okta as an example, here are the Harness Manager settings on the left and their corresponding SAML provider settings on the right:

SAML SSO with Okta

Setting up Harness with Okta as a SAML SSO provider is done by exchanging the necessary information between your Okta app and Harness.

The section describes the Okta-specific steps you must perform to use an Okta app for Harness SAML SSO:

Okta User Accounts

To set up an SAML support in your Okta app, ensure that the app has corresponding Users in Harness:

  1. Using your Harness Users email addresses, add the Harness Users to the SAML provider account and assign them to your SAML provider app. Here is an example of two Harness Users added to an Okta app using the same email addresses.
    The only user property that must match between a Harness User and its corresponding SAML provider user account is its email address.

Endpoint URL for Okta

Enter the Harness SAML Endpoint URL in your Okta app Single sign on URL:

  1. Copy the Harness SAML Endpoint URL from the Harness Manager.
    1. In Harness, click Continuous Security, and then click Access Management.

    2. Click SSO Provider Setup. The SSO Provider page appears.

    3. Click Add SSO Provider. The Single Sign-on (SSO) Provider dialog appears.

    4. Copy the Harness SAML Endpoint URL from the dialog. You will provide this Harness SAML Endpoint URL to your SAML provider app in the next step. This is where the SAML provider will post the SAML response after authentication.
  2. Add the Harness SAML Endpoint URL to your SAML provider app.
    1. In your SAML provider app, in its Single sign on URL field (or similar name), enter in the Harness SAML Endpoint URL you copied. For example, here is where you enter the Harness SSO URL in Okta when you are creating an app (Classic UI view only):

    2. In your SAML provider app, for the Audience URI field (or similar name), enter app.harness.io. The SAML application identifier should be always app.harness.io.

Okta SAML Metadata File

You must download the Identity Provider metadata XML from your Okta app and upload the file into Harness.

  1. Download the SAML metadata file from your Okta provider app.
    For example, here is what the SAML metadata file section looks like in an Okta application, in its Sign On tab (only available in Classic UI view):

  2. In Harness, in the Single Sign-on (SSO) Provider dialog, in Upload a new SAML Metadata File, click Choose File and add the SAML metadata file you downloaded.

    1. In Display Name, enter a name for your SAML SSO provider, and click SUBMIT. The new SSO provider is displayed.

Enable and Test SSO with Okta

Now that Okta is set up in Harness as a SAML SSO provider, you can enable and test it.

  1. To enable the SSO provider, click the checkbox under Enabled.


    SAML SSO is now enabled in Harness.
    If you become locked out of Harness because of a SSO issue, you must contact Harness to have the SSO Provider disabled.
  2. Test the SSO Provider in Harness.

    To test SSO, you will log into Harness using another User account. You should use a Chrome Incognito window to test SSO so that you can disable SSO back in your Harness Administrator account if there are any errors.
    1. Open an Incognito window in Chrome.
    2. Log into Harness using a Harness User account that has a corresponding user account email address in the SAML SSO provider. You will be redirected to your SAML SSO provider's login page.
    3. Log into your SSO Provider using an email address for a Harness User. The password does not have to be the same.
      You are automatically returned to the Harness Manager, and logged into the dashboard using your SSO credentials.

SAML Authorization with Okta

Once you have enabled Harness SSO with your Okta app, you can set up and enable SAML authorization in Harness using Okta.

To set up SAML authorization in Harness, you link a Harness User Group to a user group in Okta. When a user from Okta logs into Harness, they are automatically added to the linked Harness User Group, and inherit all the RBAC settings for that User Group.

There are two Okta components you need to set up SAML authorization in Harness:

  • Group Name - The name of the Okta group containing the users you want to authorize in Harness. The email addresses registered in this group must be the same as the email addresses these users have registered in Harness.
  • Group Attribute Name - The Group Attribute Name associated with the Okta app you use for authentication. The Group Attribute Name is different from the Okta group name. Your company might have many groups set up in Okta. The Group Attribute Name is used to filter groups.

In Harness, you will enter the Group Attribute Name in the SAML SSO provider settings, and then you will enter the group name in the Harness User Group to link it to the Okta group.

Here are the Harness Manager settings on the left and their corresponding Okta settings on the right:

Remember that email addresses are how Harness identifies Users. Always ensure that the email addresses of your registered Harness Users match the Okta users you want to authenticate and authorize.

To set up SAML Authorization with Okta, do the following:

  1. Set up SAML SSO in Harness as described in SAML SSO with Okta.
    1. You will be authorizing the same Harness Users that are authenticated using your SAML provider, so ensure that the email addresses registered in Harness are the same email addresses registered in your SAML provider.
  2. Add a user group to your SAML provider, and then add users to the group. The group name will be used to link the Harness User Group later.

    In Okta, here is a user group named QA with two members:


    Both members are already registered in Harness using the same email addresses in both Harness and the SAML provider.
  3. Ensure the SAML provider group is assigned to the same SAML provider app you use for Harness SAML SSO. Here is the same SAML provider group assigned to an app in Okta:

  4. Configure the Group Attribute Name in your SAML app. You will use the Group Attribute Name later in Harness when you enable SAML authorization.

    Here are the steps for adding a Group Attribute Name in Okta:
    1. In Okta, click Applications, and then click the name of the app you use for Harness SAML SSO to open its settings.
    2. In the app, click the General tab.
    3. For SAML Settings, click Edit.
    4. In General Settings, click Next.

    5. In GROUP ATTRIBUTE STATEMENTS (OPTIONAL), in Name, enter the Group Attribute Name you want to use, such as dept.
    6. In Filter, select Matches regex and enter period asterisk (.*) in the field. When you are done, it will something like this:

    7. Click Next.
    8. Click Finish.
  5. Enable Authorization in Harness. Now that you have assigned a group to your SAML app and added a Group Attribute Name, you can enable authorization in Harness.
    1. In Harness, click Continuous Security, and then click Access Management.
    2. Click SSO Provider. Remember, we are simply adding authorization to a SAML SSO provider that is already configured for authentication and enabled, as described in To Set Up SAML SSO.
    3. In SSO Provider, click the vertical ellipsis () next to the SSO Provider you have set up for SSO authentication, and click Edit.

    4. In the Single Sign-On (SSO) Provider dialog, enable Enable Authorization.
    5. In Group Attribute Name, enter the Group Attribute Name you added to your SAML app in your SAMP provider earlier.

    6. Click SUBMIT. The SAML SSO Provider is now set up to use the Group Attribute Name for authorization.
  6. Link the SAML SSO Provider to the Harness User Group. We will create a new Harness User Group, but you can use an existing Group so long as your Harness User account is a member and that User account is registered using the same email address you used to register with your SAML provider.
    1. Click the Access Management breadcrumb.
    2. Click User Groups.
    3. Click Add User Group.
    4. In Add User Group, enter a name for the User Group and click SUBMIT. In this example, we use the name QA.
    5. In the new User Group, click Member Users.
    6. In Add Members, add your own User account as a member. Also, ensure your Harness account is registered using the same email address you used to register with your SAML provider.

      Do not add any other Harness Users at this point. When the other users log into Harness using the same email address as they use in the SAML provider, Harness will verify their email addresses with the SAML provider and add them to this linked Harness User Group automatically.
    7. Click SUBMIT.
    8. In the User Group page, in Member Users, click Link to SSO Provider Group.

    9. In the Link to SSO Provider Group dialog, in SSO Provider, select the SAML SSO Provider you have set up.
    10. In Group Name, enter the name of the group you assigned to your app in your SAML provider. When you are done, it will look something like this:

    11. Click SUBMIT.
  7. Test the SAML Authorization using another user account. We will test the SAML authorization using an email address for a user in Harness and the SAML provider.

    Do not log out of Harness. Use a different Harness User account in a Chrome Incognito window to ensure that you can disable SSO if needed.
    1. In Chrome, open an Incognito window, and navigate to Harness.
    2. Log into Harness using the email address of a Harness User that is also used in the SAML provider group linked to the Harness User Group.

      When the user submits their email address in Harness Manager, the user is redirected to the SAML provider to log in. For example, here is the Okta prompt:

    3. Log into the SAML provider using the same email that the user is registered with in Harness.

      Once the user logs in, the user is redirected to Harness and logged into Harness using the SAML credentials.
    4. In your Harness account in the other browser window, check the User Group you linked with your SAML provider. The user that logged in is now added to the User Group, receiving the authorization associated with that User Group.

You can link multiple Harness User Groups with the SAML SSO Provider you set up in Harness.

You can also remove a link between a Harness User Group and a Harness SAML SSO Provider without losing the User Group members. In the Harness User Group, simply click Delink Group:

The Delink External SSO Provider Group dialog appears.

Click Retain all members in the user group and click Confirm. The link to the SAML SSO Provider is removed and the Users are still members of the User Group.

You cannot delete a SAML SSO Provider from Harness that is linked to a Harness Group. You must first remove the link to the SSO Provider from the Group.

SAML SSO with Azure

The section describes the Azure-specific steps you must perform to use an Azure app for Harness SAML SSO:

The following image shows the basic exchange of information between Harness and your Azure app's Single sign-on settings:

Azure User Accounts

The Harness User accounts and their corresponding Azure user accounts must have the same email addresses.

  1. Ensure that you have at least two corresponding user accounts in both Harness and your Azure app when setting up and testing SAML SSO. This allows you to set up the account with a Harness Administrator account and test it with a Harness user account.

The following image shows a Harness User Group containing two users and their corresponding accounts in the Azure app that will be used for SAML SSO. As you can see, the email addresses are the same.

Endpoint URL for Azure

You must enter the Harness SAML Endpoint URL from Harness in your Azure app Reply URL:

  1. In your Azure app, click Single sign-on. The SSO settings for the Azure app are displayed.

  2. In Basic SAML Configuration, click the edit icon (pencil).
  3. Enter app.harness.io in the Identifier (Entity ID) field.



    Next, you will use the SAML SSO Provider settings in Harness to set up your Azure app Single sign-on.
  4. In Harness, click Continuous Security, and then click Access Management.
  5. Click SSO Providers, and then click Add SSO Provider and choose SAML. The Add SAML Provider dialog appears.

  6. In Display Name, enter a name for the SAML SSO Provider, such as Azure.
  7. Copy the Harness SAML Endpoint URL from the Add SAML Provider dialog, and paste it in the Reply URL in your Azure app.

  8. Click Save. The Basic SAML Configuration now looks like this:

User Attributes & Claims

Next, you need to ensure that Harness Users email addresses will identify them when they log in via Azure. To do this, you set up the Single sign-on section of your Azure app to use the User name email address as the method to identify users.

The Azure users that are added to your Azure app must have their email addresses listed as their User name, for example:

To set this User name email address as the method for identifying users, in the Azure app Single sign-on section, the Azure app must use the user.userprincipalname as the Unique User Identifier, and user.userprincipalname must use Email address as the name identifier format.

To set this up in your Azure app, do the following:

  1. In your Azure app, in the Single sign-on blade, in User Attributes & Claims, click the edit icon (pencil). The User Attributes & Claims settings appear.

  2. For Name identifier value, click the edit icon. The Manage user claims settings appear.

  3. Click Choose name identifier format, and select Email address.
  4. In Source attribute, select user.userprincipalname.
  5. Click Save, and then close User Attributes & Claims. When you are finished, the User Attributes & Claims section of Single sign-on will look like this:

If your Azure users are set up with their email addresses in some field other than User name, just ensure that the field is mapped to the Unique User Identifier in the Azure app and the name identifier format is Email address.

Azure SAML Metadata File

You must download the Federation Metadata XML from your Azure app and upload the file into Harness.

  1. Download the Federation Metadata XML from your Azure app and upload it using Upload a new SAML Metadata File in the Add SAML Provider dialog in Harness.

  2. In Harness, in the Add SAML Provider dialog, click SUBMIT. The new Azure SAML Provider is added.

Enable and Test SSO with Azure

Now that Azure is set up in Harness as a SAML SSO provider, you can enable and test it.

You can test the Azure app SSO from within Azure if you are logged into Azure using a Azure user account that has the following:

  • A corresponding Harness User account with the same email address.
  • The Azure user account is in the Azure app Users and groups settings.
  • The Azure user account has the Global Administrator Directory role in Azure.

To test Azure SSO using Azure, do the following:

  1. In the Azure app, click Single sign-on, and then at the bottom of the Single sign-on settings, click Test.

  2. In the Test panel, click Sign in as current user. If the settings are correct, you are logged into Harness. If you cannot log into Harness, the Test panel will provide debugging information. See also Debug SAML-based single sign-on to applications in Azure Active Directory from Azure.

To test Azure SSO using Harness, do the following:

  1. In Harness, in SSO Providers, click the Enabled checkbox to enable SAML SSO using the Azure provider.
  2. Open a new Chrome Incognito window to test the SSO login using a Harness User account other than the one you are currently logged in with.
  3. Using one of the user account email addresses that is shared by Harness and Azure, log into Harness. When you log into Harness, you are prompted with the Microsoft Sign in dialog.
  4. Enter the Azure user name for the user (most often, the email address), enter the Azure password, and click Sign in.



SAML Authorization with Azure

Once you have enabled Harness SSO with your Azure app, you can set up and enable SAML authorization in Harness using Azure.

To set up SAML authorization in Harness, you link a Harness User Group to a user group assigned to your Azure app. When a user from your Azure app logs into Harness, they are automatically added to the linked Harness User Group, and inherit all the RBAC settings for that Harness User Group.

There are two Harness SAML settings you need from Azure to set up SAML authorization in Harness:

  • Group Attribute Name - In Azure, this value is obtained from the Group Claims in the Azure app User Attributes & Claims settings.
  • Group Name - The Object ID of the Azure group containing the Azure users you want to authorize in Harness. The email addresses registered in this Azure group must be the same as the email addresses these users have registered in Harness.

For Harness Group Attribute Name, here is the Harness SAML Provider setting on the left and their corresponding Azure Group Claims settings on the right:

For Harness Group Name, here is the Harness User Group link setting on the left and the Azure group Object ID on the right.

To set up Azure Authorization in Harness, do the following:

  1. In Azure, add the Group Claim (Name and Namespace) to the Azure app.
    1. In your Azure app, click Single sign-on, and then in User Attributes & Claims, click edit (pencil icon).

    2. In User Attributes & Claims, edit the Groups returned in claim. The Group Claims settings appear.

    3. Click the All groups option and then enable Customize the name of the group claim.
    4. In Name, enter a name to use to identify the Harness Group Attribute Name.
    5. In Namespace, enter a namespace name. When you are done, Group Claims will look something like this:

    6. Click Save. User Attributes & Groups now displays the group claim you created.

    7. Close User Attributes & Groups.
  2. In Harness, enter the Group Claim name and namespace in the SAML SSO Provider Group Attribute Name field.
    1. Open the SAML SSO Provider dialog, and enable the Enable Authorization setting. You need to enable Enable Authorization in order to select this SSO Provider when you link a Harness User Group for authorization.
    2. Enter the Group Claim name and namespace in the Group Attribute Name field in the same format as a Claim Name (namespace/name). The SAML SSO Provider dialog will look something like this:

    3. Click SUBMIT. Authorization and the Group Attribute Name are set up. Next, you need to set up your Azure and Harness groups.
  3. In Azure, ensure the Azure users with corresponding Harness accounts belong to an Azure group. Here is an Azure group named Example with two members:

  4. Ensure that the Azure group is assigned to the Azure app. Here you can see the Example group in the Azure app's Users and groups:

  5. Link the Harness User Group to the Azure group using the Azure group Object ID.
    1. In Azure, copy the Azure group Object ID.

    2. In Harness, create a new User Group or open an existing User Group.
    3. In the Member Users section, click Link to SSO Provider Group.

    4. In the Link to SSO Provider Group dialog, in SSO Provider, select the Azure SSO Provider you set up, and in Group Name, paste the Object ID you copied from Azure. When you are done, the dialog will look something like this:

    5. Click SUBMIT. The User Group is now linked to the SAML SSO Provider and Azure group Object ID.

  6. Test Authorization.
    1. Open a new Chrome Incognito window to test the authorization using a Harness User account other than the one you are currently logged in with.
    2. Log into Harness using the user email address, and sign in using the Azure username and password. If you are already logged into Azure in Chrome, you might be logged into Harness automatically.
    3. In the linked Harness User Group, ensure that the Harness User account you logged in with was added.


      The Harness User is now added and the RBAC settings for the Harness User Group are applied to its account. For more information, see Managing Users and Groups (RBAC).

SAML SSO with Google G Suite

Harness supports SAML integration with Google G Suite to enable your employees to use their Google account credentials to sign into the Harness platform.

For information about G Suite and SAML, see Service provider SSO set up from Google.

To set up SAML with Google, you must be a G Suite administrator. To integrate G Suite SAML with Harness, your Harness account must be a member of the Account Administrator group. For more information, see Users and Permissions.

First, we will set up Harness as a SSO SAML app with Google G Suite, and then we will configure Harness to use Google G Suite for SSO.

If you become locked out of Harness because of a SSO issue, you must contact Harness to have the SSO Provider disabled.

Add Harness as G Suite SSO App

To set up SAML with Google G Suite, do the following:

  1. Log into your G Suite Admin console.
  2. From the Admin console Home page, go to SAML apps.

  3. Click the plus sign next to Enable SSO for a SAML Application.

  4. In Step 1, at the bottom, click SETUP MY OWN CUSTOM APP.

  5. In Step 2, the Google IdP Information appears, including the SSO URL and Entity ID URLs.


    1. In Option 2, click DOWNLOAD to download the IDP metadata to your computer. The IDP metadata file will be used to set up G Suite SSO in Harness.
    2. Click NEXT.
  6. In Step 3, in Application Name, enter app.harness.io.
    The SAML application identifier should be always app.harness.io.
    1. Now you will get the Harness logo so your employees will easily identify Harness in their G Suite apps. In another browser tab, download the Harness logo from https://harness.io/images/harness_logo.png.
    2. Back in Step 3, in Upload logo, click CHOOSE FILE, and upload the Harness logo.
    3. Click NEXT.
  7. In Step 4, provide the Harness provider details.
    1. In ACS URL, enter the Harness SAML Endpoint URL from the Harness Single Sign-on (SSO) Provider dialog. To obtain this URL, in Harness, click Continuous Security, and then click Access Management.



    2. On the SSO Provider page, click Add SSO Provider, and click SAML.


      The Single Sign-on (SSO) Provider dialog appears.
    3. Copy the Harness SAML Endpoint URL from the dialog and enter it in ACS URL in G Suite.

    4. In Entity ID, enter Harness.
    5. In Start URL, enter the same URL you entered for ACS URL.
    6. Leave Signed Response unchecked, and click NEXT.
  8. In Step 5, click FINISH.
  9. In the Harness service provider page, click the pencil icon to turn on the new Harness SSO app.

  10. In the Status setting, click Settings for all organizational units.

  11. In the Service Status settings, click ON for everyone, and then click SAVE.

Next, add G Suite as a Harness SSO provider for your Harness account.

Add G Suite as a Harness SSO Provider

To add the Harness SSO G Suite App you created as a Harness SSO Provider, do the following:

  1. Log into Harness with an account that is in the Harness Account Administrator group.
  2. In Harness, click Continuous Security, and then click Access Management.
  3. Click SSO Provider Setup.
  4. Click Add SSO Provider. The Single Sign-on (SSO) Provider dialog appears.

  5. Click Choose File, and upload the IDP metadata file you downloaded from Google.
  6. In Display Name, enter a name to identify this SSO account, such as Google, and click SUBMIT.
  7. Back in the Single Sign-on(SSO) Provider Setup list, enable the new SSO provider.

  8. You are finished. To test the provider, log out of Harness.
  9. Open a G Suite app, such as Mail, and locate the Harness app you added by clicking the Google Apps icon.

  10. Click the Harness app icon and you will be redirected to app.Harness.io, and logged in.

Notes

Here are two popular SSO providers:


How did we do?