ICookieAuthenticationEvents Interface

Specifies callback methods which the Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationMiddleware invokes to enable developer control over the authentication process. />

Namespace
Microsoft.AspNetCore.Authentication.Cookies
Assemblies
  • Microsoft.AspNetCore.Authentication.Cookies

Syntax

public interface ICookieAuthenticationEvents
interface Microsoft.AspNetCore.Authentication.Cookies.ICookieAuthenticationEvents

Methods

RedirectToAccessDenied(Microsoft.AspNetCore.Authentication.Cookies.CookieRedirectContext)

Called when an access denied causes a redirect in the cookie middleware.

Arguments:context (Microsoft.AspNetCore.Authentication.Cookies.CookieRedirectContext) – Contains information about the event
Return type:System.Threading.Tasks.Task
Task RedirectToAccessDenied(CookieRedirectContext context)
RedirectToLogin(Microsoft.AspNetCore.Authentication.Cookies.CookieRedirectContext)

Called when a SignIn causes a redirect in the cookie middleware.

Arguments:context (Microsoft.AspNetCore.Authentication.Cookies.CookieRedirectContext) – Contains information about the event
Return type:System.Threading.Tasks.Task
Task RedirectToLogin(CookieRedirectContext context)
RedirectToLogout(Microsoft.AspNetCore.Authentication.Cookies.CookieRedirectContext)

Called when a SignOut causes a redirect in the cookie middleware.

Arguments:context (Microsoft.AspNetCore.Authentication.Cookies.CookieRedirectContext) – Contains information about the event
Return type:System.Threading.Tasks.Task
Task RedirectToLogout(CookieRedirectContext context)
RedirectToReturnUrl(Microsoft.AspNetCore.Authentication.Cookies.CookieRedirectContext)

Called when redirecting back to the return url in the cookie middleware.

Arguments:context (Microsoft.AspNetCore.Authentication.Cookies.CookieRedirectContext) – Contains information about the event
Return type:System.Threading.Tasks.Task
Task RedirectToReturnUrl(CookieRedirectContext context)
SignedIn(Microsoft.AspNetCore.Authentication.Cookies.CookieSignedInContext)

Called when an endpoint has provided sign in information after it is converted into a cookie.

Arguments:context (Microsoft.AspNetCore.Authentication.Cookies.CookieSignedInContext) – Contains information about the login session as well as the user System.Security.Claims.ClaimsIdentity.
Return type:System.Threading.Tasks.Task
Task SignedIn(CookieSignedInContext context)
SigningIn(Microsoft.AspNetCore.Authentication.Cookies.CookieSigningInContext)

Called when an endpoint has provided sign in information before it is converted into a cookie. By implementing this method the claims and extra information that go into the ticket may be altered.

Arguments:context (Microsoft.AspNetCore.Authentication.Cookies.CookieSigningInContext) – Contains information about the login session as well as the user System.Security.Claims.ClaimsIdentity.
Return type:System.Threading.Tasks.Task
Task SigningIn(CookieSigningInContext context)
SigningOut(Microsoft.AspNetCore.Authentication.Cookies.CookieSigningOutContext)

Called during the sign-out flow to augment the cookie cleanup process.

Arguments:context (Microsoft.AspNetCore.Authentication.Cookies.CookieSigningOutContext) – Contains information about the login session as well as information about the authentication cookie.
Return type:System.Threading.Tasks.Task
Task SigningOut(CookieSigningOutContext context)
ValidatePrincipal(Microsoft.AspNetCore.Authentication.Cookies.CookieValidatePrincipalContext)

Called each time a request principal has been validated by the middleware. By implementing this method the application may alter or reject the principal which has arrived with the request.

Arguments:context (Microsoft.AspNetCore.Authentication.Cookies.CookieValidatePrincipalContext) – Contains information about the login session as well as the user System.Security.Claims.ClaimsIdentity.
Return type:System.Threading.Tasks.Task
Returns:A System.Threading.Tasks.Task representing the completed operation.
Task ValidatePrincipal(CookieValidatePrincipalContext context)