Local host issue while Okta setup with Sonarqube

we have added a new application for Sonarqube in Okta and then we configured SAML Authentication in Sonarqube with all the details mentioned in the documentation, our SAML authentication is also successfully added but still we are not able to sign in using Okta.

our Sonarqube is installed on our private server which is secured also but when we Log in with Okta then it redirect to ‘http://localhost:9000/sessions/unauthorized’. our Sonarqube instance is at ‘https://serverName.company.com’ , we are not sure where that localhost is coming from?

we have followed below documentation.

Hey there.

What version of SonarQube are you using?

Hi Colin, we are using sonarqube 10.2 developer edition


Ultimately, back at the host machine, your SonarQube server is probably running on localhost:9000 and some kind of proxy (apache, nginx, IIS) is helping server your SonarQube server over HTTPS on a publicly accessible address.

Do you know which reverse proxy (like the ones listed before) is responsible for this?

yes Colin, we have used IIS fot that

For help with IIS and SAML Authentication, please review this Community guide for additional steps.

thanks Colin,
we followed the steps which you have mentioned but even after ‘Uncheck the box `Reverse rewrite host in response headers’ we are getting unauthorized page.

how to resolve that?

At this point, I would suggest looking into the logs (specifically web.log) after triggering authentication to see if you get a specific error.

Thanks Colin, it worked after restart.