100 references to Authorize
Aspire.Dashboard (3)
Otlp\Grpc\OtlpGrpcLogsService.cs (1)
12[Authorize(Policy = OtlpAuthorization.PolicyName)]
Otlp\Grpc\OtlpGrpcMetricsService.cs (1)
12[Authorize(Policy = OtlpAuthorization.PolicyName)]
Otlp\Grpc\OtlpGrpcTraceService.cs (1)
12[Authorize(Policy = OtlpAuthorization.PolicyName)]
Aspire.Hosting (1)
Dashboard\DashboardService.cs (1)
20[Authorize(Policy = ResourceServiceApiKeyAuthorization.PolicyName)]
BasicWebSite (1)
Controllers\AuthorizeUserController.cs (1)
18[Authorize(Roles = "Administrator")]
ClaimsTransformation (1)
Controllers\HomeController.cs (1)
18[Authorize]
Cookies (1)
Controllers\HomeController.cs (1)
18[Authorize]
CustomAuthorizationFailureResponse (3)
Controllers\SampleController.cs (3)
15[Authorize(Policy = SamplePolicyNames.CustomPolicyWithCustomForbiddenMessage)] 22[Authorize(Policy = SamplePolicyNames.CustomPolicy)] 29[Authorize(Policy = SamplePolicyNames.FailureReasonPolicy)]
IdentitySample.Mvc (2)
Controllers\AccountController.cs (1)
15[Authorize]
Controllers\ManageController.cs (1)
13[Authorize]
Microsoft.AspNetCore.Authorization.Policy (3)
AuthorizationEndpointConventionBuilderExtensions.cs (3)
28return builder.RequireAuthorization(new AuthorizeAttribute()); 69authorizeData = new IAuthorizeData[] { new AuthorizeAttribute(), }; 142endpointBuilder.Metadata.Add(new AuthorizeAttribute());
Microsoft.AspNetCore.Authorization.Test (38)
AuthorizationAppBuilderExtensionsTests.cs (1)
29new EndpointMetadataCollection(new AuthorizeAttribute()),
AuthorizationEndpointConventionBuilderExtensionsTests.cs (3)
17var metadata = new AuthorizeAttribute(); 173var authorize = new AuthorizeAttribute(); 200var authorize = new AuthorizeAttribute();
AuthorizationMiddlewareTests.cs (23)
115var context = GetHttpContext(anonymous: true, endpoint: CreateEndpoint(new AuthorizeAttribute()), authenticationService: authenticationService); 136var context = GetHttpContext(anonymous: true, endpoint: CreateEndpoint(new AuthorizeAttribute()), authenticationService: authenticationService); 158var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute() { AuthenticationSchemes = "whatever" }), authenticationService: authenticationService); 180var context = GetHttpContext(anonymous: true, endpoint: CreateEndpoint(new AuthorizeAttribute()), authenticationService: authenticationService); 433var context = GetHttpContext(anonymous: false, endpoint: CreateEndpoint(new AuthorizeAttribute(), policy)); 513var context = GetHttpContext(anonymous: false, endpoint: CreateEndpoint(new AuthorizeAttribute(), new ReqAttribute(req))); 553var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute())); 573var context = GetHttpContext(anonymous: true, endpoint: CreateEndpoint(new AuthorizeAttribute(), new AllowAnonymousAttribute()), authenticationService: authenticationService); 594var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute()), authenticationService: authenticationService); 616var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute()), authenticationService: authenticationService); 638var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute())); 662var endpoint = CreateEndpoint(new AuthorizeAttribute()); 691var endpoint = CreateEndpoint(new AuthorizeAttribute()); 712var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute()), authenticationService: authenticationService); 734var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute()), authenticationService: authenticationService); 757var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute()), authenticationService: authenticationService); 778var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute())); 802var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute(), new AllowAnonymousAttribute()), authenticationService: authenticationService); 842var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute()), authenticationService: authenticationService.Object); 865var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute())); 891var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute())); 930var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute()), authenticationService: authenticationService.Object); 956var context = GetHttpContext(endpoint: CreateEndpoint(new AuthorizeAttribute()));
AuthorizationPolicyFacts.cs (9)
22new AuthorizeAttribute(), 25new AuthorizeAttribute { Roles = "r1,r2", AuthenticationSchemes = "roles" }, 51new AuthorizeAttribute(), 52new AuthorizeAttribute(), 74new AuthorizeAttribute(), 100new AuthorizeAttribute() { Roles = "r1 , r2" } 121new AuthorizeAttribute() { AuthenticationSchemes = "a1 , a2" } 141new AuthorizeAttribute() { AuthenticationSchemes = "a1 , , ,,, a2" } 161new AuthorizeAttribute() { Roles = "r1 , ,, , r2" }
DefaultAuthorizationServiceTests.cs (1)
31new AuthorizeAttribute { Policy = "Wut" }
MetadataTest.cs (1)
14var metadata = new AuthorizeAttribute();
Microsoft.AspNetCore.Components.Authorization.Tests (2)
AuthorizeRouteViewTest.cs (1)
379[Authorize]
AuthorizeViewTest.cs (1)
575=> new[] { new AuthorizeAttribute { AuthenticationSchemes = "test scheme" } };
Microsoft.AspNetCore.Components.Endpoints.Tests (4)
RazorComponentEndpointFactoryTest.cs (4)
29new object[] { new AuthorizeAttribute() }), 60builder => builder.Metadata.Add(new AuthorizeAttribute()) 89builder => builder.Metadata.Add(new AuthorizeAttribute()) 144builder => builder.Metadata.Add(new AuthorizeAttribute())
Microsoft.AspNetCore.Http.Connections.Tests (6)
HttpConnectionDispatcherTests.cs (2)
3962[Authorize] 3989[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
MapConnectionHandlerTests.cs (4)
163options.AuthorizationData.Add(new AuthorizeAttribute()); 222options.AuthorizationData.Add(new AuthorizeAttribute()); 466[Authorize] 471[Authorize]
Microsoft.AspNetCore.Mvc.Core (1)
Authorization\AuthorizeFilter.cs (1)
31: this(authorizeData: new[] { new AuthorizeAttribute() })
Microsoft.AspNetCore.Mvc.Core.Test (12)
ApiConventionTypeAttributeTest.cs (2)
60var attributes = new Attribute[] { new ProducesAttribute(typeof(object)), new ServiceFilterAttribute(typeof(object)), new AuthorizeAttribute() }; 75[Authorize]
ApplicationModels\AuthorizationApplicationModelProviderTest.cs (3)
219[Authorize(Policy = "Base")] 227[Authorize(Policy = "Derived")] 233[Authorize]
Authorization\AuthorizeFilterTest.cs (7)
56var authorizeFilter = new AuthorizeFilter(new[] { new AuthorizeAttribute() }); 72var authorizeFilter = new AuthorizeFilter(new[] { new AuthorizeAttribute() }); 259new AuthorizeAttribute { Policy = "true"}, 260new AuthorizeAttribute { Policy = "false"} 283new AuthorizeAttribute { Policy = "true"}, 284new AuthorizeAttribute { Policy = "false"} 457new AuthorizeFilter(new[] { new AuthorizeAttribute()}),
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
AuthorizeFilterIntegrationTest.cs (1)
215[Authorize(Policy = "Base")]
Microsoft.AspNetCore.Mvc.RazorPages.Test (5)
ApplicationModels\AuthorizationPageApplicationModelProviderTest.cs (4)
47[Authorize] 98[Authorize] 141[Authorize(Policy = "Base")] 146[Authorize(Policy = "Derived")]
ApplicationModels\ResponseCacheFilterApplicationModelProviderTest.cs (1)
44[Authorize]
Microsoft.AspNetCore.Routing.Tests (1)
TestObjects\TestMatcherFactory.cs (1)
70metadataList.Add(new AuthorizeAttribute());
Microsoft.AspNetCore.SignalR.Tests (5)
AuthConnectionHandler.cs (1)
11[Authorize]
AuthHub.cs (1)
8[Authorize]
MapSignalRTests.cs (3)
240options.AuthorizationData.Add(new AuthorizeAttribute()); 377[Authorize] 386[Authorize]
Negotiate.Server (2)
Controllers\AuthController.cs (2)
26[Authorize] 39[Authorize]
PathSchemeSelection (1)
Controllers\HomeController.cs (1)
18[Authorize]
RazorPagesWebSite (2)
Controllers\AuthorizedActionController.cs (1)
10[Authorize]
Pages\ModelWithAuthFilter.cs (1)
10[Authorize]
SecurityWebSite (5)
Controllers\AdministrationController.cs (1)
22[Authorize(AuthenticationSchemes = "Cookie2")]
Controllers\AuthorizedController.cs (2)
9[Authorize] // requires any authenticated user (aka the application cookie typically) 12[Authorize(AuthenticationSchemes = "Bearer")]
Controllers\HomeController.cs (2)
17[Authorize] 24[Authorize]