hkamel / sonar-auth-aad

Azure Active Directory Authentication for SonarQube

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to authenticate after configuring the plugin

aanvekar001 opened this issue · comments

Hi,

I configured this plugin into sonarqube and performed all the steps mentioned in this link -> https://github.com/hkamel/sonar-auth-aad/wiki/Setup

I still cannot login to this sonar, after I click on "Log in with Microsoft":
image

is this something knows issue? is this part of confguration?

Hi,

unfortunately, I have the same issue on a brand new SQ install.
The URL I am being sent back to from AzureAD my SQ is:

https://sonarserver01/5a7298ad-1e10-4555-8e48-4b6af1ea99b/oauth2/authorize?client_id=3cafb3c3-0908-4cb6-9bbb-fedec1b48ff&response_type=code&redirect_uri=http://localhost:9000/oauth2/callback/aad&state=h0g889abo9t4dset567ur5ri&scope=openid

all guids have been altered above and I have a reverse proxy inplace for SSL on windows, none of this should affect his anyway.
Isnt the return URL created when the login button sends the user to the session\new page?
I dont think it should have localhost:9000 in there ?

EDIT:
I noticed in a different issue the localhost is created when the server base url isnt set, I have set this now and still get the page not found error with the correct redirect_uri

In addition to setting the server base URL, if you're using IIS as a reverse proxy, you need to do some additional configuration. Follow the steps over on the troubleshooting section of our documentation wiki: https://github.com/hkamel/sonar-auth-aad/wiki/Troubleshooting#im-never-getting-sent-to-the-microsoft-login-page

Let me know if that is the case and if that fixes things if so.

thanks @srvrguy thats spot on, in IIS you have to turn off the rewrite in the response header.
Just to note I didnt think that was applicable as I am getting to the MS login screen, and being returned to SQ, but now I know the headers were breaking it.

thanks!