/// <summary> /// Enables forms authentication for a module /// </summary> /// <param name="module">Module to add handlers to (usually "this")</param> /// <param name="configuration">Forms authentication configuration</param> public static void Enable(INancyModule module, FormsAuthenticationConfiguration configuration) { if (module == null) { throw new ArgumentNullException("module"); } if (configuration == null) { throw new ArgumentNullException("configuration"); } configuration.EnsureConfigurationIsValid(); module.RequiresAuthentication(); currentConfiguration = configuration; module.Before.AddItemToStartOfPipeline(GetLoadAuthenticationHook(configuration)); if (!configuration.DisableRedirect) { module.After.AddItemToEndOfPipeline(GetRedirectToLoginHook(configuration)); } }
/// <summary> /// Enables forms authentication for a module /// </summary> /// <param name="module">Module to add handlers to (usually "this")</param> /// <param name="configuration">Forms authentication configuration</param> public static void Enable(INancyModule module, FormsAuthenticationConfiguration configuration) { if (module == null) { throw new ArgumentNullException("module"); } if (configuration == null) { throw new ArgumentNullException("configuration"); } configuration.EnsureConfigurationIsValid(); module.RequiresAuthentication(); currentConfiguration = configuration; module.Before.AddItemToStartOfPipeline(GetLoadAuthenticationHook(configuration)); if (!configuration.DisableRedirect) { module.After.AddItemToEndOfPipeline(GetRedirectToLoginHook(configuration)); } }
/// <summary> /// Enables forms authentication for the application /// </summary> /// <param name="pipelines">Pipelines to add handlers to (usually "this")</param> /// <param name="configuration">Forms authentication configuration</param> public static void Enable(IPipelines pipelines, FormsAuthenticationConfiguration configuration) { if (pipelines == null) { throw new ArgumentNullException("pipelines"); } if (configuration == null) { throw new ArgumentNullException("configuration"); } configuration.EnsureConfigurationIsValid(); currentConfiguration = configuration; pipelines.BeforeRequest.AddItemToStartOfPipeline(GetLoadAuthenticationHook(configuration)); if (!configuration.DisableRedirect) { pipelines.AfterRequest.AddItemToEndOfPipeline(GetRedirectToLoginHook(configuration)); } }
/// <summary> /// Enables forms authentication for the application /// </summary> /// <param name="pipelines">Pipelines to add handlers to (usually "this")</param> /// <param name="configuration">Forms authentication configuration</param> public static void Enable(IPipelines pipelines, FormsAuthenticationConfiguration configuration) { if (pipelines == null) { throw new ArgumentNullException("pipelines"); } if (configuration == null) { throw new ArgumentNullException("configuration"); } configuration.EnsureConfigurationIsValid(); currentConfiguration = configuration; pipelines.BeforeRequest.AddItemToStartOfPipeline(GetLoadAuthenticationHook(configuration)); if (!configuration.DisableRedirect) { pipelines.AfterRequest.AddItemToEndOfPipeline(GetRedirectToLoginHook(configuration)); } }