/// <summary>
 /// This module requires authentication and certain claims to be present.
 /// </summary>
 /// <param name="module">Module to enable</param>
 /// <param name="requiredClaims">Claim(s) required</param>
 public static void RequiresClaims(this INancyModule module, params Predicate <Claim>[] requiredClaims)
 {
     module.AddBeforeHookOrExecute(SecurityHooks.RequiresAuthentication(), "Requires Authentication");
     module.AddBeforeHookOrExecute(SecurityHooks.RequiresClaims(requiredClaims), "Requires Claims");
 }
Exemplo n.º 2
0
 /// <summary>
 /// This module requires authentication and certain claims to be present.
 /// </summary>
 /// <param name="module">Module to enable</param>
 /// <param name="requiredClaims">Claim(s) required</param>
 public static void RequiresClaims(this INancyModule module, IEnumerable <string> requiredClaims)
 {
     module.AddBeforeHookOrExecute(SecurityHooks.RequiresAuthentication(), "Requires Authentication");
     module.AddBeforeHookOrExecute(SecurityHooks.RequiresClaims(requiredClaims), "Requires Claims");
 }
Exemplo n.º 3
0
 /// <summary>
 /// This module requires authentication and certain claims to be present.
 /// </summary>
 /// <param name="module">Module to enable</param>
 /// <param name="requiredClaims">Claim(s) required</param>
 public static void RequiresClaims(this INancyModule module, IEnumerable <string> requiredClaims)
 {
     module.Before.AddItemToEndOfPipeline(SecurityHooks.RequiresAuthentication());
     module.Before.AddItemToEndOfPipeline(SecurityHooks.RequiresClaims(requiredClaims));
 }