Method | Description | |
---|---|---|
Enable ( IPipelines pipelines, Nancy.Authentication.Forms.FormsAuthenticationConfiguration configuration ) : void |
Enables forms authentication for the application
|
|
LogOutAndRedirectResponse ( NancyContext context, string redirectUrl ) : Response |
Logs the user out and redirects them to a URL
|
|
LogOutResponse ( ) : Response |
Logs the user out.
|
|
UserLoggedInRedirectResponse ( NancyContext context, System.Guid userIdentifier, System.DateTime cookieExpiry = null, string fallbackRedirectUrl = "/" ) : Response |
Creates a response that sets the authentication cookie and redirects the user back to where they came from.
|
|
UserLoggedInResponse ( System.Guid userIdentifier, System.DateTime cookieExpiry = null ) : Response |
Logs the user in.
|
Method | Description | |
---|---|---|
BuildCookie ( System.Guid userIdentifier, System.DateTime cookieExpiry, Nancy.Authentication.Forms.FormsAuthenticationConfiguration configuration ) : INancyCookie |
Build the forms authentication cookie
|
|
BuildLogoutCookie ( Nancy.Authentication.Forms.FormsAuthenticationConfiguration configuration ) : INancyCookie |
Builds a cookie for logging a user out
|
|
DecryptAndValidateAuthenticationCookie ( string cookieValue, Nancy.Authentication.Forms.FormsAuthenticationConfiguration configuration ) : string |
Decrypt and validate an encrypted and signed cookie value
|
|
EncryptAndSignCookie ( string cookieValue, Nancy.Authentication.Forms.FormsAuthenticationConfiguration configuration ) : string |
Encrypt and sign the cookie contents
|
|
GenerateHmac ( string encryptedCookie, Nancy.Authentication.Forms.FormsAuthenticationConfiguration configuration ) : byte[] |
Generate a hmac for the encrypted cookie string
|
|
GetAuthenticatedUserFromCookie ( NancyContext context, Nancy.Authentication.Forms.FormsAuthenticationConfiguration configuration ) : System.Guid |
Gets the authenticated user GUID from the incoming request cookie if it exists and is valid.
|
|
GetLoadAuthenticationHook ( Nancy.Authentication.Forms.FormsAuthenticationConfiguration configuration ) : Response>.Func |
Gets the pre request hook for loading the authenticated user's details from the cookie.
|
|
GetRedirectToLoginHook ( Nancy.Authentication.Forms.FormsAuthenticationConfiguration configuration ) : Action |
Gets the post request hook for redirecting to the login page
|
public static Enable ( IPipelines pipelines, Nancy.Authentication.Forms.FormsAuthenticationConfiguration configuration ) : void | ||
pipelines | IPipelines | Pipelines to add handlers to (usually "this") |
configuration | Nancy.Authentication.Forms.FormsAuthenticationConfiguration | Forms authentication configuration |
return | void |
public static LogOutAndRedirectResponse ( NancyContext context, string redirectUrl ) : Response | ||
context | NancyContext | Current context |
redirectUrl | string | URL to redirect to |
return | Response |
public static UserLoggedInRedirectResponse ( NancyContext context, System.Guid userIdentifier, System.DateTime cookieExpiry = null, string fallbackRedirectUrl = "/" ) : Response | ||
context | NancyContext | Current context |
userIdentifier | System.Guid | User identifier guid |
cookieExpiry | System.DateTime | Optional expiry date for the cookie (for 'Remember me') |
fallbackRedirectUrl | string | Url to redirect to if none in the querystring |
return | Response |
public static UserLoggedInResponse ( System.Guid userIdentifier, System.DateTime cookieExpiry = null ) : Response | ||
userIdentifier | System.Guid | User identifier guid |
cookieExpiry | System.DateTime | Optional expiry date for the cookie (for 'Remember me') |
return | Response |