5 instantiations of AuthorizationPolicy
Microsoft.AspNetCore.Authorization (1)
AuthorizationPolicyBuilder.cs (1)
229return new AuthorizationPolicy(Requirements, AuthenticationSchemes.Distinct());
Microsoft.AspNetCore.Components.Authorization.Tests (1)
TestAuthorizationPolicyProvider.cs (1)
19new AuthorizationPolicy(new[]
Microsoft.AspNetCore.Mvc.Core.Test (2)
ApplicationModels\AuthorizationApplicationModelProviderTest.cs (2)
129var authorizationPolicy = new AuthorizationPolicy(requirements, new string[] { "dingos" }); 155var authorizationPolicy = new AuthorizationPolicy(requirements, new string[] { "dingos" });
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
AuthorizeFilterIntegrationTest.cs (1)
204return Task.FromResult(new AuthorizationPolicy(requirements, new string[] { }));
246 references to AuthorizationPolicy
Aspire.Dashboard (7)
Authentication\AspirePolicyEvaluator.cs (7)
32/// Does authentication for <see cref="AuthorizationPolicy.AuthenticationSchemes"/> and sets the resulting 35/// <param name="policy">The <see cref="AuthorizationPolicy"/>.</param> 37/// <returns><see cref="AuthenticateResult.Success"/> unless all schemes specified by <see cref="AuthorizationPolicy.AuthenticationSchemes"/> failed to authenticate.</returns> 38public virtual async Task<AuthenticateResult> AuthenticateAsync(AuthorizationPolicy policy, HttpContext context) 95/// <param name="policy">The <see cref="AuthorizationPolicy"/>.</param> 96/// <param name="authenticationResult">The result of a call to <see cref="AuthenticateAsync(AuthorizationPolicy, HttpContext)"/>.</param> 105public virtual async Task<PolicyAuthorizationResult> AuthorizeAsync(AuthorizationPolicy policy, AuthenticateResult authenticationResult, HttpContext context, object? resource)
CustomAuthorizationFailureResponse (1)
Authorization\SampleAuthorizationMiddlewareResultHandler.cs (1)
28AuthorizationPolicy authorizationPolicy,
CustomPolicyProvider (3)
Authorization\MinimumAgePolicyProvider.cs (3)
31public Task<AuthorizationPolicy> GetDefaultPolicyAsync() => FallbackPolicyProvider.GetDefaultPolicyAsync(); 33public Task<AuthorizationPolicy> GetFallbackPolicyAsync() => FallbackPolicyProvider.GetFallbackPolicyAsync(); 39public Task<AuthorizationPolicy> GetPolicyAsync(string policyName)
Microsoft.AspNetCore.Authorization (70)
AuthorizationBuilder.cs (10)
46public virtual AuthorizationBuilder SetDefaultPolicy(AuthorizationPolicy policy) 53/// Sets the fallback authorization policy used by <see cref="AuthorizationPolicy.CombineAsync(IAuthorizationPolicyProvider, IEnumerable{IAuthorizeData})"/> 61public virtual AuthorizationBuilder SetFallbackPolicy(AuthorizationPolicy? policy) 68/// Adds a <see cref="AuthorizationPolicy"/> which can be used by <see cref="IAuthorizationService"/>. 71/// <param name="policy">The <see cref="AuthorizationPolicy"/>.></param> 73public virtual AuthorizationBuilder AddPolicy(string name, AuthorizationPolicy policy) 95/// <param name="policy">The default <see cref="AuthorizationPolicy"/>.></param> 97public virtual AuthorizationBuilder AddDefaultPolicy(string name, AuthorizationPolicy policy) 122/// <param name="policy">The Fallback <see cref="AuthorizationPolicy"/>.></param> 124public virtual AuthorizationBuilder AddFallbackPolicy(string name, AuthorizationPolicy policy)
AuthorizationOptions.cs (12)
16private static readonly Task<AuthorizationPolicy?> _nullPolicyTask = Task.FromResult<AuthorizationPolicy?>(null); 18private Dictionary<string, Task<AuthorizationPolicy?>> PolicyMap { get; } = new Dictionary<string, Task<AuthorizationPolicy?>>(StringComparer.OrdinalIgnoreCase); 32public AuthorizationPolicy DefaultPolicy { get; set; } = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 35/// Gets or sets the fallback authorization policy used by <see cref="AuthorizationPolicy.CombineAsync(IAuthorizationPolicyProvider, IEnumerable{IAuthorizeData})"/> 42public AuthorizationPolicy? FallbackPolicy { get; set; } 49public void AddPolicy(string name, AuthorizationPolicy policy) 54PolicyMap[name] = Task.FromResult<AuthorizationPolicy?>(policy); 69PolicyMap[name] = Task.FromResult<AuthorizationPolicy?>(policyBuilder.Build()); 77public AuthorizationPolicy? GetPolicy(string name) 89internal Task<AuthorizationPolicy?> GetPolicyTask(string name)
AuthorizationPolicy.cs (24)
20/// Creates a new instance of <see cref="AuthorizationPolicy"/>. 49/// Gets a readonly list of the authentication schemes the <see cref="AuthorizationPolicy.Requirements"/> 55/// Combines the specified <see cref="AuthorizationPolicy"/> into a single policy. 59/// A new <see cref="AuthorizationPolicy"/> which represents the combination of the 62public static AuthorizationPolicy Combine(params AuthorizationPolicy[] policies) 66return Combine((IEnumerable<AuthorizationPolicy>)policies); 70/// Combines the specified <see cref="AuthorizationPolicy"/> into a single policy. 74/// A new <see cref="AuthorizationPolicy"/> which represents the combination of the 77public static AuthorizationPolicy Combine(IEnumerable<AuthorizationPolicy> policies) 82foreach (var policy in policies) 90/// Combines the <see cref="AuthorizationPolicy"/> provided by the specified 96/// A new <see cref="AuthorizationPolicy"/> which represents the combination of the 99public static Task<AuthorizationPolicy?> CombineAsync(IAuthorizationPolicyProvider policyProvider, 101Enumerable.Empty<AuthorizationPolicy>()); 104/// Combines the <see cref="AuthorizationPolicy"/> provided by the specified 109/// <param name="policies">A collection of <see cref="AuthorizationPolicy"/> policies to combine.</param> 111/// A new <see cref="AuthorizationPolicy"/> which represents the combination of the 114public static async Task<AuthorizationPolicy?> CombineAsync(IAuthorizationPolicyProvider policyProvider, 116IEnumerable<AuthorizationPolicy> policies) 143var policy = await policyProvider.GetPolicyAsync(authorizeDatum.Policy).ConfigureAwait(false); 183foreach (var policy in policies) 192var fallbackPolicy = await policyProvider.GetFallbackPolicyAsync().ConfigureAwait(false);
AuthorizationPolicyBuilder.cs (7)
32/// <param name="policy">The <see cref="AuthorizationPolicy"/> to copy.</param> 33public AuthorizationPolicyBuilder(AuthorizationPolicy policy) 90/// <param name="policy">The <see cref="AuthorizationPolicy"/> to combine.</param> 92public AuthorizationPolicyBuilder Combine(AuthorizationPolicy policy) 221/// Builds a new <see cref="AuthorizationPolicy"/> from the requirements 225/// A new <see cref="AuthorizationPolicy"/> built from the requirements in this instance. 227public AuthorizationPolicy Build()
AuthorizationServiceExtensions.cs (2)
46public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService service, ClaimsPrincipal user, object? resource, AuthorizationPolicy policy) 64public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService service, ClaimsPrincipal user, AuthorizationPolicy policy)
DefaultAuthorizationPolicyProvider.cs (8)
13/// which provides a <see cref="AuthorizationPolicy"/> for a particular name. 18private Task<AuthorizationPolicy>? _cachedDefaultPolicy; 19private Task<AuthorizationPolicy?>? _cachedFallbackPolicy; 36public Task<AuthorizationPolicy> GetDefaultPolicyAsync() 50public Task<AuthorizationPolicy?> GetFallbackPolicyAsync() 61/// Gets a <see cref="AuthorizationPolicy"/> from the given <paramref name="policyName"/> 64/// <returns>The named <see cref="AuthorizationPolicy"/>.</returns> 65public virtual Task<AuthorizationPolicy?> GetPolicyAsync(string policyName)
DefaultAuthorizationService.cs (1)
103var policy = await _policyProvider.GetPolicyAsync(policyName).ConfigureAwait(false);
IAuthorizationPolicyProvider.cs (6)
9/// A type which can provide a <see cref="AuthorizationPolicy"/> for a particular name. 14/// Gets a <see cref="AuthorizationPolicy"/> from the given <paramref name="policyName"/> 17/// <returns>The named <see cref="AuthorizationPolicy"/>.</returns> 18Task<AuthorizationPolicy?> GetPolicyAsync(string policyName); 24Task<AuthorizationPolicy> GetDefaultPolicyAsync(); 30Task<AuthorizationPolicy?> GetFallbackPolicyAsync();
Microsoft.AspNetCore.Authorization.Policy (32)
AuthorizationEndpointConventionBuilderExtensions.cs (3)
80/// <param name="policy">The <see cref="AuthorizationPolicy"/> policy.</param> 82public static TBuilder RequireAuthorization<TBuilder>(this TBuilder builder, AuthorizationPolicy policy) 134private static void RequirePolicyCore<TBuilder>(TBuilder builder, AuthorizationPolicy policy)
AuthorizationMiddleware.cs (5)
106AuthorizationPolicy? policy = null; 118var policies = endpoint?.Metadata.GetOrderedMetadata<AuthorizationPolicy>() ?? Array.Empty<AuthorizationPolicy>(); 120policy = await AuthorizationPolicy.CombineAsync(_policyProvider, authorizeData, policies); 137: AuthorizationPolicy.Combine(policy, reqPolicy.Build());
AuthorizationMiddlewareResultHandler.cs (1)
15public Task HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
AuthorizationPolicyCache.cs (6)
13private readonly DataSourceDependentCache<ConcurrentDictionary<Endpoint, AuthorizationPolicy>> _policyCache; 19_policyCache = new DataSourceDependentCache<ConcurrentDictionary<Endpoint, AuthorizationPolicy>>(dataSource, (_) => 22return new ConcurrentDictionary<Endpoint, AuthorizationPolicy>(); 27public AuthorizationPolicy? Lookup(Endpoint endpoint) 29_policyCache.Value!.TryGetValue(endpoint, out var policy); 33public void Store(Endpoint endpoint, AuthorizationPolicy policy)
IAuthorizationMiddlewareResultHandler.cs (2)
21/// <param name="policy">The <see cref="AuthorizationPolicy"/> for the resource.</param> 23Task HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult);
IPolicyEvaluator.cs (7)
16/// Does authentication for <see cref="AuthorizationPolicy.AuthenticationSchemes"/> and sets the resulting 19/// <param name="policy">The <see cref="AuthorizationPolicy"/>.</param> 21/// <returns><see cref="AuthenticateResult.Success"/> unless all schemes specified by <see cref="AuthorizationPolicy.AuthenticationSchemes"/> fail to authenticate. </returns> 22Task<AuthenticateResult> AuthenticateAsync(AuthorizationPolicy policy, HttpContext context); 27/// <param name="policy">The <see cref="AuthorizationPolicy"/>.</param> 28/// <param name="authenticationResult">The result of a call to <see cref="AuthenticateAsync(AuthorizationPolicy, HttpContext)"/>.</param> 37Task<PolicyAuthorizationResult> AuthorizeAsync(AuthorizationPolicy policy, AuthenticateResult authenticationResult, HttpContext context, object? resource);
PolicyAuthorizationResult.cs (1)
7/// The result of <see cref="IPolicyEvaluator.AuthorizeAsync(AuthorizationPolicy, Authentication.AuthenticateResult, Http.HttpContext, object?)"/>.
PolicyEvaluator.cs (7)
28/// Does authentication for <see cref="AuthorizationPolicy.AuthenticationSchemes"/> and sets the resulting 31/// <param name="policy">The <see cref="AuthorizationPolicy"/>.</param> 33/// <returns><see cref="AuthenticateResult.Success"/> unless all schemes specified by <see cref="AuthorizationPolicy.AuthenticationSchemes"/> failed to authenticate. </returns> 34public virtual async Task<AuthenticateResult> AuthenticateAsync(AuthorizationPolicy policy, HttpContext context) 84/// <param name="policy">The <see cref="AuthorizationPolicy"/>.</param> 85/// <param name="authenticationResult">The result of a call to <see cref="AuthenticateAsync(AuthorizationPolicy, HttpContext)"/>.</param> 94public virtual async Task<PolicyAuthorizationResult> AuthorizeAsync(AuthorizationPolicy policy, AuthenticateResult authenticationResult, HttpContext context, object? resource)
Microsoft.AspNetCore.Authorization.Test (85)
AuthorizationBuilderTests.cs (5)
16var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 31var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 47var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 78var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 100var policy = options.GetPolicy("name");
AuthorizationEndpointConventionBuilderExtensionsTests.cs (6)
125var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build(); 163var policy = Assert.IsAssignableFrom<AuthorizationPolicy>(endpointModel.Metadata[1]); 189var policy = Assert.IsAssignableFrom<AuthorizationPolicy>(endpointModel.Metadata[1]); 199var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build();
AuthorizationMiddlewareResultHandlerTests.cs (7)
19var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 33var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 47var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 65var policy = new AuthorizationPolicyBuilder() 86var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 104var policy = new AuthorizationPolicyBuilder() 125var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build();
AuthorizationMiddlewareTests.cs (33)
27var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 46var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 66var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 85var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 106var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 128var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 150var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 172var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().AddAuthenticationSchemes("schema1", "schema2").Build(); 194var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build(); 236var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build(); 278var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build(); 335public new Task<AuthorizationPolicy> GetFallbackPolicyAsync() 341public override Task<AuthorizationPolicy> GetPolicyAsync(string policyName) 356var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build(); 388var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build(); 423var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => 547var policy = new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewPage").Build(); 566var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 587var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build(); 608var policy = new AuthorizationPolicyBuilder("Fails").RequireAuthenticatedUser().Build(); 632var policy = new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewComment", "CanViewPage").Build(); 652var policy = new AuthorizationPolicyBuilder().RequireAssertion(c => 681var policy = new AuthorizationPolicyBuilder().RequireAssertion(c => 705var policy = new AuthorizationPolicyBuilder().RequireRole("Wut").Build(); 727var policy = new AuthorizationPolicyBuilder().RequireRole("Wut").AddAuthenticationSchemes("Basic", "Bearer").Build(); 748var policy = new AuthorizationPolicyBuilder() 772var policy = new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewPage").Build(); 795var policy = new AuthorizationPolicyBuilder().RequireRole("Wut").AddAuthenticationSchemes("NotImplemented").Build(); 818var policy = new AuthorizationPolicyBuilder().RequireRole("Wut").AddAuthenticationSchemes("Basic", "Bearer").Build(); 859var policy = new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewPage").Build(); 885var policy = new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewPage").Build(); 917var policy = new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewPage").AddAuthenticationSchemes("Bearer").Build(); 951var policy = new AuthorizationPolicyBuilder().RequireClaim("Permission", "CanViewPage").Build();
AuthorizationPolicyFacts.cs (14)
34var combined = await AuthorizationPolicy.CombineAsync(provider, attributes); 62var combined = await AuthorizationPolicy.CombineAsync(provider, attributes, policies); 84var combined = await AuthorizationPolicy.CombineAsync(provider, attributes); 106var combined = await AuthorizationPolicy.CombineAsync(provider, attributes); 128var combined = await AuthorizationPolicy.CombineAsync(provider, attributes); 148var combined = await AuthorizationPolicy.CombineAsync(provider, attributes); 167var combined = await AuthorizationPolicy.CombineAsync(provider, attributes);
DefaultAuthorizationServiceTests.cs (12)
30await Assert.ThrowsAsync<InvalidOperationException>(() => AuthorizationPolicy.CombineAsync(provider, new AuthorizeAttribute[] { 725var basePolicy = new AuthorizationPolicyBuilder().RequireClaim("Base", "Value").Build(); 753var basePolicy = new AuthorizationPolicyBuilder().RequireClaim("Base", "Value").Build(); 780var basePolicy = new AuthorizationPolicyBuilder().RequireClaim("Base", "Value").Build(); 997public Task<AuthorizationPolicy> GetDefaultPolicyAsync() 1002public Task<AuthorizationPolicy> GetFallbackPolicyAsync() 1004return Task.FromResult<AuthorizationPolicy>(null); 1007public Task<AuthorizationPolicy> GetPolicyAsync(string policyName) 1036public Task<AuthorizationPolicy> GetDefaultPolicyAsync() 1041public Task<AuthorizationPolicy> GetFallbackPolicyAsync() 1043return Task.FromResult<AuthorizationPolicy>(null); 1046public Task<AuthorizationPolicy> GetPolicyAsync(string policyName)
PolicyEvaluatorTests.cs (8)
21var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build(); 38var policy = new AuthorizationPolicyBuilder().AddAuthenticationSchemes("A", "B", "C").RequireAssertion(_ => true).Build(); 57var policy = new AuthorizationPolicyBuilder().AddAuthenticationSchemes("A").RequireAssertion(_ => true).Build(); 74var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build(); 91var policy = new AuthorizationPolicyBuilder().RequireAssertion(c => c.Resource != null).Build(); 109var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => false).Build(); 126var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => false).Build(); 143var policy = new AuthorizationPolicyBuilder()
Microsoft.AspNetCore.Components.Authorization (2)
AuthorizeViewCore.cs (2)
110var policy = await AuthorizationPolicy.CombineAsync(
Microsoft.AspNetCore.Components.Authorization.Tests (3)
TestAuthorizationPolicyProvider.cs (3)
12public Task<AuthorizationPolicy> GetDefaultPolicyAsync() 15public Task<AuthorizationPolicy> GetFallbackPolicyAsync() 18public Task<AuthorizationPolicy> GetPolicyAsync(string policyName) => Task.FromResult(
Microsoft.AspNetCore.Http.Connections.Tests (3)
MapConnectionHandlerTests.cs (3)
37var policy1 = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build(); 52var policies = endpoint.Metadata.GetOrderedMetadata<AuthorizationPolicy>(); 62var policies = endpoint.Metadata.GetOrderedMetadata<AuthorizationPolicy>();
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Infrastructure\FunctionalTestsServiceCollectionExtensions.cs (1)
47var policy = new AuthorizationPolicyBuilder()
Microsoft.AspNetCore.Mvc.Core (13)
ApplicationModels\AuthorizationApplicationModelProvider.cs (2)
76var policy = AuthorizationPolicy.CombineAsync(policyProvider, authData).GetAwaiter().GetResult()!;
Authorization\AuthorizeFilter.cs (11)
18/// <see cref="AuthorizationPolicy"/>. MVC recognizes the <see cref="AuthorizeAttribute"/> and adds an instance of 39public AuthorizeFilter(AuthorizationPolicy policy) 94/// <see cref="AuthorizationPolicy.CombineAsync(IAuthorizationPolicyProvider, IEnumerable{IAuthorizeData})"/>. 96public AuthorizationPolicy? Policy { get; } 101private async ValueTask<AuthorizationPolicy> ComputePolicyAsync() 112nameof(AuthorizationPolicy), 116return (await AuthorizationPolicy.CombineAsync(PolicyProvider, AuthorizeData!))!; 119internal async Task<AuthorizationPolicy> GetEffectivePolicyAsync(AuthorizationFilterContext context) 148var endpointPolicy = await AuthorizationPolicy.CombineAsync(policyProvider, endpointAuthorizeData); 169var effectivePolicy = await GetEffectivePolicyAsync(context);
Microsoft.AspNetCore.Mvc.Core.Test (13)
ApplicationModels\AuthorizationApplicationModelProviderTest.cs (2)
129var authorizationPolicy = new AuthorizationPolicy(requirements, new string[] { "dingos" }); 155var authorizationPolicy = new AuthorizationPolicy(requirements, new string[] { "dingos" });
Authorization\AuthorizeFilterTest.cs (11)
233private readonly AuthorizationPolicy _true = 235private readonly AuthorizationPolicy _false = 240public Task<AuthorizationPolicy> GetDefaultPolicyAsync() 243public Task<AuthorizationPolicy> GetPolicyAsync(string policyName) 249public Task<AuthorizationPolicy> GetFallbackPolicyAsync() 250=> Task.FromResult<AuthorizationPolicy>(null); 473var policy = new AuthorizationPolicyBuilder() 514var policy1 = new AuthorizationPolicyBuilder() 518var policy2 = new AuthorizationPolicyBuilder() 539var policy1 = new AuthorizationPolicyBuilder() 543var policy2 = new AuthorizationPolicyBuilder()
Microsoft.AspNetCore.Mvc.IntegrationTests (6)
AuthorizeFilterIntegrationTest.cs (6)
58var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build(); 89var policy = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build(); 191public Task<AuthorizationPolicy> GetDefaultPolicyAsync() 196public Task<AuthorizationPolicy> GetPolicyAsync(string policyName) 207public Task<AuthorizationPolicy> GetFallbackPolicyAsync() 209return Task.FromResult<AuthorizationPolicy>(null);
Microsoft.AspNetCore.Security.Microbenchmarks (1)
AuthorizationPolicyBenchmark.cs (1)
23return AuthorizationPolicy.CombineAsync(_policyProvider, Array.Empty<IAuthorizeData>());
Microsoft.AspNetCore.SignalR.Core (2)
Internal\DefaultHubDispatcher.cs (2)
681var authorizePolicy = await AuthorizationPolicy.CombineAsync(policyProvider, policies);
Microsoft.AspNetCore.SignalR.Tests (3)
MapSignalRTests.cs (3)
106var policy1 = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build(); 124var policies = endpoint.Metadata.GetOrderedMetadata<AuthorizationPolicy>(); 134var policies = endpoint.Metadata.GetOrderedMetadata<AuthorizationPolicy>();
SecurityWebSite (1)
CountingPolicyEvaluator.cs (1)
16public override Task<PolicyAuthorizationResult> AuthorizeAsync(AuthorizationPolicy policy, AuthenticateResult authenticationResult, HttpContext context, object resource)