/// <summary>
 /// Adds a policy to check for required scopes.
 /// </summary>
 /// <param name="builder"></param>
 /// <param name="scope">List of any required scopes. The token must contain at least one of the listed scopes.</param>
 /// <returns></returns>
 public static AuthorizationPolicyBuilder RequireScope(this AuthorizationPolicyBuilder builder, params string[] scope)
 {
     return(builder.RequireClaim(JwtClaimTypes.Scope, scope));
 }
Ejemplo n.º 2
0
 public static AuthorizationPolicyBuilder RequirePermission(this AuthorizationPolicyBuilder builder, string permission)
 {
     builder.RequireClaim("permissions", permission);
     return(builder);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds a <see cref="Infrastructure.ClaimsAuthorizationRequirement"/> to the current instance.
 /// </summary>
 /// <param name="claimType">The claim type required, which no restrictions on claim value.</param>
 /// <returns>A reference to this instance after the operation has completed.</returns>
 public AcceptancePolicyBuilder RequireClaim(string claimType)
 {
     _builder.RequireClaim(claimType);
     return(this);
 }