I need to allow users to login through Corp network to access an internal web application.
I've followed all the steps given in the official documentation and it works fine.
However, a strange error that I am getting while logging in is that the authentication pages goes into a redirect loop every other day.
As per now the immediate fix for me is to change the Application/Client ID
for the application in my web.config
file.
<add key="ClientId" value="Enter_the_Application_Id_here" />
<add key="redirectUri" value="Enter_the_Redirect_URL_here" />
<add key="Tenant" value="common" />
<add key="Authority" value="https://login.microsoftonline.com/{0}/v2.0" />
So as of now, I've got 2 different Applications created in Microsoft Identity Platform and I reuse the same App Id
(switching them every time one stops working) and as soon as I change the App Id
, the login starts working.
Not sure if I am missing something, but haven't found anything related to this exact problem other than a few like https://github.com/aspnet/Security/issues/219 which does not work for me. And to my understanding and suggestions over the internet if this was a Permission related issue, it should never allow login but it does.
Turns out that it was an issue with configuration of the AD.
I went to my Azure App Service > Settings > Authentication/Authorization
and created a new AD App, and used the App ID
of this app
in my web application and it is now working fine.
It sounds strange that your corp login is in a loop. is it possible that it goes to your app but so 'fast' you don't notice it. I'm saying this because I have a web app and had a similar loop. and I found that the process was:
But if you check your login to soon. At step 3 it won't know it is logged in yet, so it goes back to step 1. hence the loop.
If your login sequence is auto triggered on app startup it could be the same as what I got.
Greetings Glenn
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With