0

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

Greg
  • 168
  • 7

1 Answers1

0

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
kavyaS
  • 8,026
  • 1
  • 7
  • 19
  • Points 1 and 2 were checked and are fine. I am going to check 3 and 4 today – Greg Nov 26 '21 at 09:42
  • Went through 3 and 4 and still got same problem. In fact I did miss Outbound Rule and "Reverse rewrite host in response headers" but even after changing this still got same problem. Connection should not be blocked, i tried this url: https://login.microsoftonline.com//oauth2/v2.0/authorize?client_id=&redirect_uri=https:///oauth2/callback/aad&scope=openid&response_type=code to simulate authentication event and connectivity works but i am redirected to the page with error: You're not authorized to access this page. Please contact the administrator. – Greg Dec 01 '21 at 13:41