Search Results for

    Show / Hide Table of Contents

    Class CookieAuth

    static class for easy cookie based auth

    Inheritance
    object
    CookieAuth
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: FastEndpoints.Security
    Assembly: FastEndpoints.Security.dll
    Syntax
    public static class CookieAuth

    Methods

    SignInAsync(Action<UserPrivileges>, Action<AuthenticationProperties>?)

    creates the auth cookie and adds it to the current http response

    Declaration
    public static Task SignInAsync(Action<UserPrivileges> privileges, Action<AuthenticationProperties>? properties = null)
    Parameters
    Type Name Description
    Action<UserPrivileges> privileges

    the privileges to be assigned to the user such as claims, permissions, and roles

    Action<AuthenticationProperties> properties

    an optional action to configure authentication properties

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    InvalidOperationException

    thrown if the auth middleware hasn't been configure or method is used outside the scope of an http request

    SignOutAsync(Action<AuthenticationProperties>?)

    signs the user out from the cookie authentication scheme

    Declaration
    public static Task SignOutAsync(Action<AuthenticationProperties>? properties = null)
    Parameters
    Type Name Description
    Action<AuthenticationProperties> properties

    an optional action to configure authentication properties

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    InvalidOperationException

    thrown if the auth middleware hasn't been configured or method is used outside the scope of a http request

    In this article
    Back to top Developed by Đĵ ΝιΓΞΗΛψΚ and contributors / Licensed under MIT / Website generated by DocFX