You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
I'm getting null reference exception from cookie authentication middleware when protecting authentication ticket. This happens when the following conditions occur on request:
Sliding expiration is enabled and enough time passed so middleware tries to refresh authentication ticket (setting _shouldRenew = true)
Principal is rejected in Options.Notifications.ValidatePrincipal notification (setting Context.Principal = null)
_shouldRenew path is hit inside ApplyResponseGrantAsync() and null reference is thrown from Options.TicketDataFormat.Protect(model); because Principal was set to null.
Also Security/src/Microsoft.AspNet.Authentication.Cookies/Notifications/CookieValidateIdentityContext.cs should be probably renamed to CookieValidatePrincipalContext.cs