1

I have problem with Identity 3 in our asp.net core application. We use "standard" sign in:

var result = await _loginManager.PasswordSignInAsync(model.UserName, model.Password, false, lockoutOnFailure: false);

The result is Ok and the cookie is set in the browser and everyting looks correct but with Internet Explorer the authoriozation doesn't work on following calls to the app, the user is redirected to the loginpage again. In Chrome it works fine.

Ola Ekelund
  • 111
  • 1
  • 7
  • 1
    Have the exact same problem, I am just not using Identity but HttpContext.Authentication.SignInAsync(CookieInstance, principal). It works fine in Chrome, Firefox and Opera, but IE and Edge are not being authenticated upon entry. Did you get an Idea what causes that and how to fix it ? – astian Jun 28 '16 at 06:52
  • 1
    It turned out that there was som kind om rubbish in my IE Cookies so when I cleared all cookies and history in IE it started to work. – Ola Ekelund Jun 29 '16 at 10:53
  • clearing temporary files & website files is what is required to get it to work however it is only a temporary fix plus you cannot ask users to do this. – SSED Nov 29 '17 at 14:56

1 Answers1

0

Add [ResponseCache(NoStore = true)] to each API call as IE caches the result hence the authentication fails unless the temp files are manually cleared.

Code as follows:

  [HttpPost]
  [ResponseCache(NoStore = true)]
  public async Task<IActionResult> Login([FromBody] Login login) etc
SSED
  • 475
  • 3
  • 9
  • 22