Skip to content

SSO with SAML in SonarQube (Microsoft Entra ID)

Complete step-by-step guide to integrating Single Sign-On (SSO) authentication via SAML 2.0 in SonarQube Community and Developer Edition with Microsoft Entra ID (formerly Azure AD).

SonarQube is a leading platform for continuous inspection of code quality and security. Until recently, SSO authentication via SAML was limited to the commercial editions (Developer, Enterprise, and Data Center). However, starting with version 26.9.0, the Community edition also includes native support for SAML 2.0.

This guide documents the full process for configuring SSO with Microsoft Entra ID (Azure AD) in both editions: Community and Developer.

  • Centralization: A single authentication point for all developers.
  • Security: Leverages MFA, Conditional Access, and Entra ID policies.
  • Automation: Users are provisioned automatically on first login.
  • Group synchronization: Permissions are assigned automatically based on group membership.

Before you begin, make sure you have:

  • SonarQube instance reachable over HTTPS (required by SAML)
  • Version 26.9.0+ for Community Edition
  • Administrator access to SonarQube
  • Public URL configured (Server Base URL)
  • An Azure Active Directory / Microsoft Entra ID tenant
  • Permissions to create Enterprise Applications
  • Security groups created for SonarQube users
  • SonarQube reachable from the internet (to receive SAML responses)
  • Valid SSL certificate (Let’s Encrypt, commercial certificate, etc.)
┌─────────────────────────────────────────────────────────────────┐
│ User │
│ (cdominguez@company.com) │
└──────────────────────┬──────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Microsoft Entra ID (Azure AD) │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ Enterprise Application: "SonarQube Developer" │ │
│ │ Enterprise Application: "SonarQube Community" │ │
│ │ │ │
│ │ Groups: │ │
│ │ • sonar-administrators │ │
│ │ • sonar-developers │ │
│ │ • sonar-viewers │ │
│ └─────────────────────────────────────────────────────────┘ │
└──────────────────────┬──────────────────────────────────────────┘
│ SAML 2.0 Assertion
▼
┌─────────────────────────────────────────────────────────────────┐
│ Application Load Balancer (AWS) │
│ HTTPS:443 → sonar-dev.company.com │
│ HTTPS:443 → sonar-community.company.com │
└──────────────────────┬──────────────────────────────────────────┘
│
┌─────────────┴─────────────┐
▼ ▼
┌─────────────────┐ ┌──────────────────┐
│ SonarQube Dev │ │ SonarQube Comm │
│ EC2 t3.xlarge │ │ EC2 t3.large │
│ Port 9000 │ │ Port 9000 │
└─────────────────┘ └──────────────────┘

Groups are essential for role-based access control (RBAC). SonarQube automatically synchronizes group membership from Entra ID via SAML.

  1. Sign in to SonarQube as an administrator.
  2. Navigate to Administration → Security → Groups.
  3. Click Create Group.

Create the following groups (the names must match those in Entra ID exactly):

SonarQube Group Description Purpose
sonar-administrators Platform administrators Full administrative access
sonar-developers Development teams Create projects, run analysis
sonar-viewers Read-only users View metrics and reports

Navigate to Administration → Security → Global Permissions and assign:

Group Administer System Administer Projects Create Projects Execute Analysis
sonar-administrators ✅ ✅ ✅ ✅
sonar-developers ❌ ❌ ✅ ✅
sonar-viewers ❌ ❌ ❌ ❌

5. Step 2: Register the Application in Microsoft Entra ID

Section titled “5. Step 2: Register the Application in Microsoft Entra ID”
  1. Go to the Azure Portal.
  2. Navigate to Microsoft Entra ID → Enterprise applications.
  3. Click New application.
  4. Select Create your own application.
  5. Configure:
    • Name: SonarQube Developer (or SonarQube Community)
    • Select: Integrate any other application you don’t find in the gallery (Non-gallery)
    • Click Create.
  1. In the created application, go to Manage → Single sign-on.
  2. Select SAML.
  3. In the Basic SAML Configuration section, click Edit.
  4. Fill in the following values:
Field Value
Identifier (Entity ID) https://sonar-dev.yourdomain.com
Reply URL (Assertion Consumer Service URL) https://sonar-dev.yourdomain.com/oauth2/callback/saml
Sign on URL https://sonar-dev.yourdomain.com
Logout URL (Optional) https://sonar-dev.yourdomain.com/sessions/logout
Field Value
Identifier (Entity ID) https://sonar-community.yourdomain.com
Reply URL (Assertion Consumer Service URL) https://sonar-community.yourdomain.com/oauth2/callback/saml
Sign on URL https://sonar-community.yourdomain.com
Logout URL (Optional) https://sonar-community.yourdomain.com/sessions/logout
  1. Save the changes.

In the Set up SonarQube Developer (or Community) section, copy the following values:

Value Description Example
Login URL Entra ID authentication URL https://login.microsoftonline.com/{tenant-id}/saml2
Microsoft Entra Identifier IdP Entity ID https://sts.windows.net/{tenant-id}/
Logout URL Sign-out URL https://login.microsoftonline.com/{tenant-id}/saml2
Certificate (Base64) X.509 certificate Download and copy the contents

6. Step 3: Configure Claims and Groups in Entra ID

Section titled “6. Step 3: Configure Claims and Groups in Entra ID”

In the Entra ID application, go to Single sign-on → Attributes & Claims → Edit.

Make sure you have the following claims configured:

Claim Name Value Purpose
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name user.userprincipalname Unique user identifier
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress user.mail Email address
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname user.givenname User’s first name
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname user.surname User’s last name

6.2 Configure the Group Claim (critical for group mapping)

Section titled “6.2 Configure the Group Claim (critical for group mapping)”

This step is essential for SonarQube to synchronize groups automatically.

  1. In Attributes & Claims, find the “Add a group claim” option.
  2. Select:
    • Which groups: Groups assigned to the application (recommended) or All groups
    • Source attribute: Cloud-only group display names (if available) or sAMAccountName
  3. Under Customize, configure:
    • Name: http://schemas.xmlsoap.org/claims/Group
  4. Save the claim.
  1. In the Entra ID application, go to Manage → Users and groups.
  2. Click Add user/group.
  3. Select the groups that will have access:
    • sonar-administrators
    • sonar-developers
    • sonar-viewers
  4. Click Assign.
  1. Sign in to SonarQube as an administrator.
  2. Navigate to Administration → Configuration → Authentication → SAML.
  3. Enable Enabled.

Fill in the fields with the values obtained in Step 2:

SonarQube Field Entra ID Value Example
Application ID SonarQube Entity ID https://sonar-dev.yourdomain.com
Provider Name Descriptive name azure
Provider ID Microsoft Entra Identifier https://sts.windows.net/{tenant-id}/
SAML login url Login URL https://login.microsoftonline.com/{tenant-id}/saml2
Identity provider certificate Certificate (Base64) Paste the full certificate
SAML logout url Logout URL https://login.microsoftonline.com/{tenant-id}/saml2
Field Entra ID Claim
SAML user login attribute http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name
SAML user name attribute http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname
SAML user email attribute http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress
Field Value
SAML group attribute http://schemas.xmlsoap.org/claims/Group

Navigate to Administration → Configuration → General → Server base URL.

Make sure it is exactly your instance’s public URL:

https://sonar-dev.yourdomain.com
  1. Click Save.
  2. Click Test configuration.
  3. If everything is correct, you will be redirected to Microsoft to authenticate.

After a successful first SSO login:

  1. Go to Administration → Security → Users.
  2. Find the user who authenticated.
  3. Verify they appear in the correct groups:
    • sonar-users (default group, automatic)
    • sonar-administrators, sonar-developers, or sonar-viewers (based on Entra ID)

If the user only appears in sonar-users:

  1. Verify that the names match exactly between Entra ID and SonarQube.
  2. Review the group claim in Entra ID (Step 6.2).
  3. Confirm the user is in the group in Entra ID.
  4. Check the SonarQube logs to see the claims received.

If sonar-developers users get “You are not authorized to access this page”:

  1. Go to Administration → Security → Global Permissions.
  2. Assign to the sonar-developers group:
    • ✅ Create Projects
    • ✅ Execute Analysis
    • ✅ Administer Projects (if they need to see all projects)

Error: AADSTS50105: Your administrator has configured the application to block users...

Section titled “Error: AADSTS50105: Your administrator has configured the application to block users...”

Cause: The application requires explicit assignment and the user is not assigned.

Solution:

  1. In Entra ID, go to the application → Users and groups.
  2. Add the corresponding user or group.
  3. Alternative: Go to Properties and set “Assignment required?” to No (less secure).

Error: AADSTS50011: The reply URL specified in the request does not match...

Section titled “Error: AADSTS50011: The reply URL specified in the request does not match...”

Cause: The Server Base URL in SonarQube does not match the Reply URL in Entra ID.

Solution:

  1. Verify Server base URL in SonarQube (Administration → General).
  2. Make sure it is https:// (not http://).
  3. Confirm the Reply URL in Entra ID includes /oauth2/callback/saml.

Error: You're not authorized to access this page

Section titled “Error: You're not authorized to access this page”

Cause: The user authenticated but does not have sufficient permissions.

Solution:

  1. Verify the user is in the correct groups.
  2. Assign global permissions to the groups (Administration → Security → Global Permissions).
  3. If the sonar-developers group has no permissions, add Administer Projects.

Error: The user is not created in SonarQube

Section titled “Error: The user is not created in SonarQube”

Cause: The login claim is not configured correctly.

Solution:

  1. Verify that SAML user login attribute is http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name.
  2. Review the SonarQube logs to see the claims received.
  3. Make sure the name claim is sending a valid value.

Cause: The group claim is not configured or the names don’t match.

Solution:

  1. In Entra ID, verify the Group claim is configured (Step 6.2).
  2. Confirm the group names are identical in both systems.
  3. Verify the user is actually in the group in Entra ID.
  4. Verify the groups are assigned to the application in Entra ID.
  • User can authenticate via SSO in SonarQube Developer
  • User can authenticate via SSO in SonarQube Community
  • User is created automatically in SonarQube on first login
  • User is assigned automatically to the correct groups
  • sonar-administrators users have full access
  • sonar-developers users can create projects and analyze code
  • sonar-viewers users can view projects (with project-level permissions)
  • Logout signs out of both SonarQube and Entra ID
Terminal window
# Tail SonarQube logs in real time
sudo docker logs -f sonarqube 2>&1 | grep -i "saml\|auth\|group"
# View received SAML claims (requires DEBUG enabled)
sudo docker logs sonarqube --tail 500 2>&1 | grep -i "attribute\|claim"
# Check SonarQube status
curl -s https://sonar-dev.yourdomain.com/api/system/status | python3 -m json.tool

Configuring SSO with SAML in SonarQube through Microsoft Entra ID provides a robust and secure solution for centralized authentication. Starting with version 26.9.0, both the Community and Developer editions support this integration natively.

  1. HTTPS is mandatory: SAML requires secure communication.
  2. Exact name matching: Groups must be named identically in both systems.
  3. Server Base URL: Must be the public URL, never localhost.
  4. Assignment in Entra ID: Groups must be assigned to the application.
  5. Correct claims: Use the full claim URIs, not login URLs.

Appendix: Configuration for Multiple Instances

Section titled “Appendix: Configuration for Multiple Instances”

If you manage multiple SonarQube instances (Developer and Community), repeat steps 2–4 for each instance, making sure to:

Instance Entity ID Reply URL
Developer https://sonar-dev.yourdomain.com https://sonar-dev.yourdomain.com/oauth2/callback/saml
Community https://sonar-community.yourdomain.com https://sonar-community.yourdomain.com/oauth2/callback/saml

Both applications can share the same Entra ID tenant and the same security groups.