After implementing Office 365, capable of logging in, but receiving a Bad Request?

We have applied Office 365 Azure AD authentication to our application. However, after authentication at Office 365, it goes in a continuous cycle until it generates a Bad Request error

-one
asp.net-mvc asp.net-mvc-4 office365
source share
1 answer

This problem seems to be resolved:

https://github.com/KentorIT/owin-cookie-saver

Discontinued from the site:

Microsoft Owin has a bug in System.Web. the one that is used when running Owin applications in IIS. Which is probably 99% of us if we use the new Owin-based authentication using ASP.NET MVC5.

Fixed a bug due to which the cookie set by Owin mysteriously disappears in some cases.

This middleware is a fix for this error. Just add it before any cookie, processing middleware and saving authentication cookies.

A sequential process that seems to work so far:

  • Using Project / Manage NuGet Properties, Add Kentor.OwinCookieSaver
  • In Startup.Auth.cs , inside the public partial class Startup , before app.UseCookieAuthentication(new CookieAuthenticationOptions()); add app.UseKentorOwinCookieSaver();

shortened code example

  public partial class Startup { // LOTS OF STUFF public void ConfigureAuth(IAppBuilder app) { app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType); app.UseKentorOwinCookieSaver(); app.UseCookieAuthentication(new CookieAuthenticationOptions()); 

UPDATE:

After this change, the problem still exists.

+1
source share

All Articles