31 references to RequireClaim
Aspire.Dashboard (1)
Authentication\OpenIdConnect\AuthorizationPolicyBuilderExtensions.cs (1)
31
builder.
RequireClaim
(claimType, claimValue);
Microsoft.AspNetCore.Authorization.Test (26)
AuthorizationMiddlewareTests.cs (8)
547
var policy = new AuthorizationPolicyBuilder().
RequireClaim
("Permission", "CanViewPage").Build();
632
var policy = new AuthorizationPolicyBuilder().
RequireClaim
("Permission", "CanViewComment", "CanViewPage").Build();
749
.
RequireClaim
("Permission", "CanViewComment")
772
var policy = new AuthorizationPolicyBuilder().
RequireClaim
("Permission", "CanViewPage").Build();
859
var policy = new AuthorizationPolicyBuilder().
RequireClaim
("Permission", "CanViewPage").Build();
885
var policy = new AuthorizationPolicyBuilder().
RequireClaim
("Permission", "CanViewPage").Build();
917
var policy = new AuthorizationPolicyBuilder().
RequireClaim
("Permission", "CanViewPage").AddAuthenticationSchemes("Bearer").Build();
951
var policy = new AuthorizationPolicyBuilder().
RequireClaim
("Permission", "CanViewPage").Build();
DefaultAuthorizationServiceTests.cs (18)
40
services.AddAuthorizationBuilder().AddPolicy("Basic", policy => policy.
RequireClaim
("Permission", "CanViewPage")));
59
policy.
RequireClaim
("Permission", "CanViewPage");
76
services.AddAuthorizationBuilder().AddPolicy("Basic", policy => policy.
RequireClaim
("Permission", "CanViewPage", "CanViewAnything")));
204
services.AddAuthorizationBuilder().AddPolicy("Basic", policy => policy.
RequireClaim
("Permission", "CanViewPage", "CanViewAnything")));
226
services.AddAuthorizationBuilder().AddPolicy("Basic", policy => policy.
RequireClaim
("Permission", "CanViewPage", "CanViewAnything")));
247
services.AddAuthorizationBuilder().AddPolicy("Basic", policy => policy.
RequireClaim
("Permission", "CanViewPage")));
268
services.AddAuthorizationBuilder().AddPolicy("Basic", policy => policy.
RequireClaim
("Permission", "CanViewPage")));
287
services.AddAuthorizationBuilder().AddPolicy("Basic", policy => policy.
RequireClaim
("Permission", "CanViewPage")));
301
services.AddAuthorizationBuilder().AddPolicy("Basic", policy => policy.
RequireClaim
("Permission", "CanViewPage")));
316
services.AddAuthorizationBuilder().AddPolicy("Basic", policy => policy.
RequireClaim
("Permission", "CanViewPage")));
349
.
RequireClaim
(ClaimTypes.Role, "User");
442
var policy = new AuthorizationPolicyBuilder().
RequireClaim
("Permission", "CanViewPage");
725
var basePolicy = new AuthorizationPolicyBuilder().
RequireClaim
("Base", "Value").Build();
726
options.AddPolicy("Combined", policy => policy.Combine(basePolicy).
RequireClaim
("Claim", "Exists"));
753
var basePolicy = new AuthorizationPolicyBuilder().
RequireClaim
("Base", "Value").Build();
754
options.AddPolicy("Combined", policy => policy.Combine(basePolicy).
RequireClaim
("Claim", "Exists"));
780
var basePolicy = new AuthorizationPolicyBuilder().
RequireClaim
("Base", "Value").Build();
781
options.AddPolicy("Combined", policy => policy.Combine(basePolicy).
RequireClaim
("Claim", "Exists"));
Microsoft.AspNetCore.Mvc.Core.Test (3)
Authorization\AuthorizeFilterTest.cs (3)
146
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().
RequireClaim
("Permission", "CanViewPage").Build());
221
var authorizeFilter = new AuthorizeFilter(new AuthorizationPolicyBuilder().
RequireClaim
("Permission", "CanViewComment", "CanViewPage").Build());
407
.
RequireClaim
("Permission", "CanViewComment")
MinimalJwtBearerSample (1)
Program.cs (1)
17
policy.
RequireClaim
("is_admin", "true");