AspNetIdentity icon indicating copy to clipboard operation
AspNetIdentity copied to clipboard

HttpContext.Current null in callbacks (caused by WithCurrentCulture)

Open Bouke opened this issue 4 years ago • 0 comments

I'm using Asp.Net Identity on .Net Framework 4.8 and MVC 5. I'm using HttpContext to track contextual information about a request. However Asp.Net Identity uses ConfigureAwait(false), which means that HttpContext.Current becomes null in callbacks. For example when subclassing PortalSignInManager, HttpContext.Current is null inside SignInAsync.

I suppose WithCurrentCulture was introduced when Asp.Net Core didn't flow HttpContext. However that's no longer the case for newer versions, and this workaround is breaking my application.

Bouke avatar May 26 '21 12:05 Bouke