AspNetIdentity
AspNetIdentity copied to clipboard
HttpContext.Current null in callbacks (caused by WithCurrentCulture)
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.