title: Azure AD integration with sonarqube
body: <p>I am running sonarqube on https by using nginx reverse proxy.</p>
  <p>This is my nginx reverse proxy config.</p>
  <pre><code>
  server{
     server_name sonarqube.mydomain.co.in;
      access_log  /var/log/nginx/sonar.access.log;
      error_log   /var/log/nginx/sonar.error.log;
      proxy_buffers 16 64k;
      proxy_buffer_size 128k;
  
      location / {
          proxy_pass  http://127.0.0.1:9000;
          proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
          proxy_redirect off;
          proxy_set_header    Host            $host;
          proxy_set_header    X-Real-IP       $remote_addr;
          proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header    X-Forwarded-Proto http;
          proxy_set_header X-Forwarded-Proto https;
      }
  
      listen 443 ssl; # managed by Certbot
      ssl_certificate /etc/letsencrypt/live/sonarqube.mydomain.co.in/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/sonarqube.mydomain.co.in/privkey.pem; # managed by Certbot
      include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  
  }
  server{
      if ($host = sonarqube.mydomain.co.in) {
          return 301 https://$host$request_uri;
      } # managed by Certbot
  
  
  
      listen      80;
     server_name sonarqube.mydomain.co.in;
      return 404; # managed by Certbot
  
  
  }
  
  
  </code></pre>
  <p>I have added sonarqube from the gallery in Azure AD. After that I selected SAML in my AZURE SSO.In my reply url I have configured <a href="https://sonarqube.mydomain.co.in/oauth2/callback/saml" rel="nofollow noreferrer">https://sonarqube.mydomain.co.in/oauth2/callback/saml</a> and in my signin url <a href="https://sonarqube.mydomain.co.in" rel="nofollow noreferrer">https://sonarqube.mydomain.co.in</a>. I have configured the relative fields from azure AD to my sonarqube plugin.</p>
  <p>Now when I try to login through SAML in my sonarqube I get this error</p>
  <pre><code>You're not authorized to access this page. Please contact the administrator.
  
  Reason: The response was received at http://sonarqube.mydomain.co.in/oauth2/callback/saml instead of https://sonarqube.mydomain.co.in/oauth2/callback/saml
  </code></pre>
  <p>Is this because of my nginx reverse proxy config? How can I fix this?
  Any help would be appreciated</p>