Azure Hosted App – Login Redirect Loop

March 10, 2018

Our Software Development team encountered a weird issue on one of the MVC web based projects. In some cases, if the App is hosted in Azure and authenticated by Azure AD, the user is redirected to Microsoft Online login page. This only happens when the solutions is publish to Azure(Not in the dev environment).

 

This is a semi-famous bug(Katana Bug #197) in Microsoft Owin implementation. This bug is related to the Cookie handling algorithm and clearing out stored cookies might only be a temporary solution.

 

I would recommend to follow the bellow article first to check whether it fixes your problem.

 

https://www.laptopmag.com/articles/fix-stuck-login-office-365

 

If this doesn’t fix your problem, please get and install “Kentor.OwinCookieSaver” from the Nuget package manager in to your project. After installing, please do the following modification in “Startup.Auth.cs” file.

 

Go to “ConfigureAuth” method.

add;

 

app.UseKentorOwinCookieSaver();

 

just before;

 

app.UseCookieAuthentication(new CookieAuthenticationOptions());

 

Make sure that you install the latest package as the old package did not fix my problem. According to the latest package you might be required to change the .NET framework of your project. The latest “Kentor.OwinCookieSaver” Works with .Net Framework 4.6 or higher.

Share on Facebook
Share on Twitter
Please reload

Featured Posts

Some jQuery functions only works in Edit Page mode, not when the page is published

August 12, 2017

1/1
Please reload

Recent Posts

August 6, 2017

Please reload

Archive

Search By Tags

Please reload

Follow Us

  • Socials - FB
  • Socials - Twitter
  • Socials - Linkdin
x

x

x

x

x

x

x

x

x

x