Table of Contents

Auth0 | Setting Up SAML

Mitchell Paul-Soumis Updated by Mitchell Paul-Soumis

Read Time: 5 mins

Configuring Sonar's Auth0 integration with your SAML Identity Provider is a multistep process, requiring information to be provided across your Sonar instance and your SAML IDP.

Configuring SAML will need two consistent pieces of information from Sonar:

  1. ACS/Application URL
    1. https://sonarsoftware-prod.eu.auth0.com/login/callback?connection={yourConnectionName}
  2. Entity ID
    1. This will vary for each instance, and will need to be obtained during provider configuration. The basic format will always follow: urn:auth0:sonarsoftware-prod:{yourConnectionName}
    2. The Connection Name is generated by Sonar after a SAML provider is added. You can grab it by clicking on the Authentication Provider, selecting View Details from the dropdown, then navigating to the Identity Providers tab of the side panel.

To get started, you'll need to start the SAML Identity Provider integration in Sonar.

  1. Navigate to “Settings”
  2. Expand “Security”
  3. Select “Identity Providers”
  4. Select “Create Identity Provider”
  5. Choose “Create SAML Identity Provider” from the menu dropdown

This will open the “Create SAML Identity Provider”, which needs information from your IDP to complete on the Sonar side, and will then provide you information to complete on the IDP side.

Setting up a SAML Provider with Google Admin

Setting up a SAML Identity Provider through Google Admin is fairly linear.

  1. From the dashboard, select the “Apps” tile:
  2. Next, select the “Web and Mobile Apps” tile:
  3. Select "Add App" at the top of the table, followed by "Add custom SAML app" in the dropdown that appears:
  4. The creation takes place in a 4-step process. The first step is defining identifying information for your Google Admin Dashboard. This requests a name, and optionally, a description for the SAML app. In this example, the app is named “Sonar Auth0”, and no description is added.
  5. The second step is where the app integration provides you with access and certificate information.
    1. This information corresponds to:
      1. The SSO URL in Google corresponds to the Sign-in URL in Sonar
      2. The Entity ID is the same as the SSO URL, and isn't required as a unique entry
      3. The Certificate needs to be copied in its entirety and pasted as the Signing Certificate in Sonar
      4. The SHA-256 Fingerprint isn't brought over to Sonar. Rather, the relevant information is that the Signature Algorithm and Digest Algorithm are both SHA-256 in Sonar
      5. Finally, in Sonar, the Protocol Binding will depend on the provider. For Google, it can be either HTTP-POST or HTTP-REDIRECT
  6. A completed SAML Identity Provider might look like this in Sonar:
    Once all the information is entered, click “Create”
  7. Once the IDP is created, you'll need the Connection Name before proceeding to the next step in Google.
    1. Click on the provider in Sonar
    2. Select “View Details”
    3. Switch to the “Identity Provider” tab
    4. Keep this open to easily copy your connection name
  8. On the next page of your Google Admin SAML App creation, you'll need to fill in the ACS URL and Entity ID. This uses information from your Sonar instance, highlighted previously. These fields require information in the following format:
    1. The ACS URL format is https://sonarsoftware-prod.eu.auth0.com/login/callbackconnection?={yourConnectionName}
    2. The Entity ID format is urn:auth0:sonarsoftware-prod:{yourConnectionName}
    3. In this example, the fields would say
      1. https://sonarsoftware-prod.eu.auth0.com/login/callback?connection=qandc-demo-sonar-software-samlp-1
      2. urn:auth0:sonarsoftware-prod:qandc-demo-sonar-software-samlp-1
  9. On the final screen of the setup, you can SAML attributes and Group membership based on your users. Although this information isn't captured by Sonar, setting up Groups can be helpful for ensuring access is only given to those that require it.
As an additional guide, you can refer to Google's documentation, available here!

Setting up a SAML Provider with Microsoft Entra

Setting up a custom SAML application to complete the integration with Microsoft is a less guided and less straightforward experience. For this reason, it is highly recommended to follow this guide while creating the integration; otherwise you run the risk of having an incomplete Auth0 setup which will not work.

While Microsoft does have various systems that handle security, this guide will focus on the configuration of a security app with Microsoft Entra. For other systems, or other use cases, please refer to Microsoft's documentation.
  1. In the Microsoft Entra dashboard, select "Create your own application", then in the sidebar that opens provide a name for your app (i.e., Sonar Auth0), and finally, select the Integrate any other application you don't find in the gallery (Non-gallery) radio button, before clicking create.
  2. In the application page you're automatically sent to after creation, select Set up single sign on
  3. On the next page, select the SAML tile
  4. You'll be presented with the full setup steps immediately on the next page, which requires tackling in several stages. Unlike the presentation on the dashboard, the Auth0 configuration needs to be done in the order highlighted below.
    1. First, you need to provide the Sign-in and Sign-out URLs
    2. Next, you have to extract the Signing Certificate. This is done by first clicking on the Edit icon, then downloading the certificate through the side menu:
    3. After getting all this information, add it to your Sonar instance through the creation of a new SAML Identity Provider
      Some unseen variables are also required, including:

      - Signing Algorithm: SHA256
      - Digest Algorithm: SHA256
      - Protocol Binding: HTTP-POST
    4. Gather your connection name and supply it to Microsoft Entra as the Basic SAML Configuration by clicking on the Edit button and adding the appropriate values
      1. The Identifier (Entity ID) format is urn:auth0:sonarsoftware-prod:{yourConnectionName}
      2. The Reply URL (Assertion Consumer Service URL) is https://sonarsoftware-prod.eu.auth0.com/login/callback?connection={yourConnectionName}
  5. Once all the information is filled out, all you need to do is save your changes, and add Groups and Users to the created application.
    1. Return to the dashboard by selecting Overview, then select the Assign users and groups tile
    2. Click on Add User/Group at the top of the table
    3. Once in Add User and Groups, click on None selected to open the sidebar, select your users or groups by checking the box, click Select, and finally Assign
As an additional guide, you can refer to Microsoft's documentation, available here!

How did we do?

Contact