0

After Signing in using OWIN authentication, the identity's 'IsAuthenticated' is always false in IE11. It works just fine in Chrome though, any ideas ?

I also reloaded the page to see if secondary request worked, and it does not. I do see the cookie though in IE's dev tool.

//Setup authentication
ClaimsIdentity identity = new ClaimsIdentity(new[] {
    new Claim(ClaimTypes.Name, userName),
    new Claim(ClaimTypes.NameIdentifier, webUser.User_ID.ToString())
}, "ApplicationCookie");    
request.GetOwinContext().Authentication.SignIn(identity);

//Check authentication
ClaimsIdentity identity = request.GetOwinContext().Authentication.User.Identity as ClaimsIdentity;         

if (!identity.IsAuthenticated) return null; // In IE11, 'IsAuthenticated' is always false and the identity is not a valid  claimsIdentity

Here is my Startup code if it helps:

app.UseCookieAuthentication(new CookieAuthenticationOptions
         {
            AuthenticationType = "ApplicationCookie",            
            LoginPath = new PathString("/Auth/"),
            CookieDomain = "localhost",
            CookieName = "MyCookie"
         });
Andrew Gale
  • 63
  • 1
  • 7

0 Answers0