azureazure-active-directorysonarqubesonarqube-web

SonarQube Azure AD integration not working


I am hosting Sonarqube on windows VM with IIS and reverse proxy configured to support SSL certificate. All works for basic (user/password) authentication but I got problem making Azure AD authentication work

I followed instructions to setup Azure AD integration. I have configured Azure AD integration, provided correct Client ID, new Secret, correct tenant ID, Base server url is correct no ending "/".

Despite all steps executed properly Azure AD authentication doesn't work: when I click on button to logon using Microsoft login page sends requests and I am redirected back to logon page

I use Sonarqube 8.0.0.29455 with plugin Azure AD Authentication version 1.2.0


Solution

  • Please check with below points:

    1. The redirect URL should be configured with a correct URL, e.g. https:// sonarqube.example.com/oauth2/callback/aad. Here /oauth2/callback/aad is a must in addition to the application URL. The redirect URL must have a https or loopback address, else the Azure AD login will not work. For example, if your main URL is "https://sonarqube.example.com", you would enter "https://sonarqube.example.com/oauth2/callback/aad"

    2. Set the required permissions in portal and grant consent if required

      i) Sign in and read user profile

      ii) Read all users’ basic profiles

    3. Check the rewrite rule when Running SonarQube behind an IIS Reversed Proxy | Microsoft Docs

    4. Make sure you aren’t behind a firewall .

    Try upgrading sonarqube Restart everything after any changes made.

    References:

    1. Setup · hkamel/sonar-auth-aad Wiki (github.com)
    2. Azure AD integration with sonarqube - Stack Overflow