/// <summary> /// This module requires claims to be validated /// </summary> /// <param name="module">Module to enable</param> /// <param name="isValid">Claims validator</param> public static void RequiresValidatedClaims(this INancyModule module, Func <IEnumerable <string>, bool> isValid) { module.AddBeforeHookOrExecute(SecurityHooks.RequiresAuthentication(), "Requires Authentication"); module.AddBeforeHookOrExecute(SecurityHooks.RequiresValidatedClaims(isValid), "Requires Validated Claim"); }
/// <summary> /// This module requires claims to be validated /// </summary> /// <param name="module">Module to enable</param> /// <param name="isValid">Claims validator</param> public static void RequiresValidatedClaims(this INancyModule module, Func <IEnumerable <string>, bool> isValid) { module.Before.AddItemToStartOfPipeline(SecurityHooks.RequiresValidatedClaims(isValid)); module.Before.AddItemToStartOfPipeline(SecurityHooks.RequiresAuthentication()); }