JetBrains / teamcity-azure-active-directory

TeamCity plugin which supports authentication via Microsoft Azure Active Directory
Apache License 2.0
26 stars 19 forks source link

Log in Azure Active Directory link leads to 404 Page not found error page #45

Open markusleino opened 4 years ago

markusleino commented 4 years ago

When pressing Log in Azure Active Directory link in TeamCity login screen you get error page "404 The page is not found". Reason seems to be wrong URL. It points to TeamCity server instead of Microsoft login page. If you replace TeamCity server address with Microsoft login page address and keep rest of the URL same it works fine.

Plugin version is SNAPSHOT-20180516102618

opernes commented 4 years ago

Same issue here, trying to open a case at jetbrains and will follow up here

laurencee commented 4 years ago

Yep same issue just starting occuring for us as well a few days ago

I should add that I "fixed" this for us by hardcoding a rewrite rule in our IIS reverse proxy to specially treat that URL value:

<rule name="oauth fix" stopProcessing="true">
  <match url="^my-guid-here/oauth2/authorize(.*)" />
  <action type="Redirect" url="https://login.microsoftonline.com/my-guid-here/oauth2/authorize{R:1}" />
</rule>
laurencee commented 4 years ago

Ok I eventually figured out the actual cause of this for us, the problem was our IIS Reverse Proxy had Reverse rewrite host in response headers option enabled by someone in ARR.

After disabling that the redirect worked as expected so I'm guessing something similar is going on here for others where response header host values are being incorrectly rewritten.