Asp.net MVC azure AD authentication infinite loop

Microsoft

We have an asp.net mvc application with AAD sign in where we have OWIN configured to use OpenID Connect. When I launch the application it goes to the azure to authenticate in AD, then it goes back to the application to the controller, and its redirected back again to azure. But not all the time , sometimes it goes into an infinite loop sometime it Authenticates without any issue and displays the landing page.

Any inputs will help. 

1 Reply

Hello Venkatesh,

 

I would recommend to take a fiddler trace for both the working and non-working scenario.

Also validate the token that you are getting from Azure AD in both the working and non-working scenario. 

 

If the token that you are getting is same in both the scenarios that issue is with the authentication handler configuration on the application side.

 

If you are getting different set of claim (which is likely be the least probability) , then check the first authentication request sent to azure AD for non working scenario.

 

Regards,

Rishabh