7 implementations of IAuthorizationPolicyProvider
CustomPolicyProvider (1)
Authorization\MinimumAgePolicyProvider.cs (1)
11
internal class MinimumAgePolicyProvider :
IAuthorizationPolicyProvider
Microsoft.AspNetCore.Authorization (1)
DefaultAuthorizationPolicyProvider.cs (1)
15
public class DefaultAuthorizationPolicyProvider :
IAuthorizationPolicyProvider
Microsoft.AspNetCore.Authorization.Test (2)
DefaultAuthorizationServiceTests.cs (2)
995
public class StaticPolicyProvider :
IAuthorizationPolicyProvider
1034
public class DynamicPolicyProvider :
IAuthorizationPolicyProvider
Microsoft.AspNetCore.Components.Authorization.Tests (1)
TestAuthorizationPolicyProvider.cs (1)
8
public class TestAuthorizationPolicyProvider :
IAuthorizationPolicyProvider
Microsoft.AspNetCore.Mvc.Core.Test (1)
Authorization\AuthorizeFilterTest.cs (1)
231
private class TestPolicyProvider :
IAuthorizationPolicyProvider
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
AuthorizeFilterIntegrationTest.cs (1)
187
public class TestAuthorizationPolicyProvider :
IAuthorizationPolicyProvider
82 references to IAuthorizationPolicyProvider
CustomPolicyProvider (1)
Startup.cs (1)
20
services.AddSingleton<
IAuthorizationPolicyProvider
, MinimumAgePolicyProvider>();
Microsoft.AspNetCore.Authorization (11)
AuthorizationBuilder.cs (1)
53
/// Sets the fallback authorization policy used by <see cref="AuthorizationPolicy.CombineAsync(
IAuthorizationPolicyProvider
, IEnumerable{IAuthorizeData})"/>
AuthorizationOptions.cs (2)
12
/// Provides programmatic configuration used by <see cref="IAuthorizationService"/> and <see cref="
IAuthorizationPolicyProvider
"/>.
35
/// Gets or sets the fallback authorization policy used by <see cref="AuthorizationPolicy.CombineAsync(
IAuthorizationPolicyProvider
, IEnumerable{IAuthorizeData})"/>
AuthorizationPolicy.cs (4)
93
/// <param name="policyProvider">A <see cref="
IAuthorizationPolicyProvider
"/> which provides the policies to combine.</param>
99
public static Task<AuthorizationPolicy?> CombineAsync(
IAuthorizationPolicyProvider
policyProvider,
107
/// <param name="policyProvider">A <see cref="
IAuthorizationPolicyProvider
"/> which provides the policies to combine.</param>
114
public static async Task<AuthorizationPolicy?> CombineAsync(
IAuthorizationPolicyProvider
policyProvider,
AuthorizationServiceCollectionExtensions.cs (1)
31
services.TryAdd(ServiceDescriptor.Transient<
IAuthorizationPolicyProvider
, DefaultAuthorizationPolicyProvider>());
DefaultAuthorizationService.cs (3)
23
private readonly
IAuthorizationPolicyProvider
_policyProvider;
29
/// <param name="policyProvider">The <see cref="
IAuthorizationPolicyProvider
"/> used to provide policies.</param>
35
public DefaultAuthorizationService(
IAuthorizationPolicyProvider
policyProvider, IAuthorizationHandlerProvider handlers, ILogger<DefaultAuthorizationService> logger, IAuthorizationHandlerContextFactory contextFactory, IAuthorizationEvaluator evaluator, IOptions<AuthorizationOptions> options)
Microsoft.AspNetCore.Authorization.Policy (8)
AuthorizationMiddleware.cs (8)
18
IAuthorizationPolicyProvider
policyProvider,
37
private readonly
IAuthorizationPolicyProvider
_policyProvider;
46
/// <param name="policyProvider">The <see cref="
IAuthorizationPolicyProvider
"/>.</param>
48
IAuthorizationPolicyProvider
policyProvider)
59
/// <param name="policyProvider">The <see cref="
IAuthorizationPolicyProvider
"/>.</param>
63
IAuthorizationPolicyProvider
policyProvider,
74
/// <param name="policyProvider">The <see cref="
IAuthorizationPolicyProvider
"/>.</param>
77
IAuthorizationPolicyProvider
policyProvider,
Microsoft.AspNetCore.Authorization.Test (37)
AuthorizationMiddlewareTests.cs (35)
28
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
47
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
67
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
86
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
107
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
129
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
151
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
173
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
195
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
237
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
279
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
389
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
429
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
468
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
490
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
509
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
531
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
548
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
567
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
588
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
609
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
633
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
657
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
686
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
706
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
728
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
751
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
773
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
796
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
819
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
860
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
886
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
918
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
952
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
994
private AuthorizationMiddleware CreateMiddleware(RequestDelegate requestDelegate = null,
IAuthorizationPolicyProvider
policyProvider = null, IServiceProvider services = null, ILogger<AuthorizationMiddleware> logger = null)
DefaultAuthorizationServiceTests.cs (2)
1019
services.AddSingleton<
IAuthorizationPolicyProvider
, StaticPolicyProvider>();
1058
services.AddSingleton<
IAuthorizationPolicyProvider
, DynamicPolicyProvider>();
Microsoft.AspNetCore.Components.Authorization (1)
AuthorizeViewCore.cs (1)
46
[Inject] private
IAuthorizationPolicyProvider
AuthorizationPolicyProvider { get; set; } = default!;
Microsoft.AspNetCore.Components.Authorization.Tests (2)
AuthorizeRouteViewTest.cs (1)
32
serviceCollection.AddSingleton<
IAuthorizationPolicyProvider
, TestAuthorizationPolicyProvider>();
AuthorizeViewTest.cs (1)
568
serviceCollection.AddSingleton<
IAuthorizationPolicyProvider
>(new TestAuthorizationPolicyProvider());
Microsoft.AspNetCore.Mvc.Core (13)
ApplicationModels\AuthorizationApplicationModelProvider.cs (3)
14
private readonly
IAuthorizationPolicyProvider
_policyProvider;
17
IAuthorizationPolicyProvider
policyProvider,
70
public static AuthorizeFilter GetFilter(
IAuthorizationPolicyProvider
policyProvider, IEnumerable<IAuthorizeData> authData)
Authorization\AuthorizeFilter.cs (10)
49
/// <param name="policyProvider">The <see cref="
IAuthorizationPolicyProvider
"/> to use to resolve policy names.</param>
51
public AuthorizeFilter(
IAuthorizationPolicyProvider
policyProvider, IEnumerable<IAuthorizeData> authorizeData)
80
/// The <see cref="
IAuthorizationPolicyProvider
"/> to use to resolve policy names.
82
public
IAuthorizationPolicyProvider
? PolicyProvider { get; }
94
/// <see cref="AuthorizationPolicy.CombineAsync(
IAuthorizationPolicyProvider
, IEnumerable{IAuthorizeData})"/>.
113
nameof(
IAuthorizationPolicyProvider
)));
145
var
policyProvider = PolicyProvider ?? context.HttpContext.RequestServices.GetRequiredService<
IAuthorizationPolicyProvider
>();
206
var
policyProvider = serviceProvider.GetRequiredService<
IAuthorizationPolicyProvider
>();
Microsoft.AspNetCore.Mvc.Core.Test (5)
ApplicationModels\AuthorizationApplicationModelProviderTest.cs (1)
156
var authorizationPolicyProviderMock = new Mock<
IAuthorizationPolicyProvider
>();
Authorization\AuthorizeFilterTest.cs (4)
103
var policyProvider = new Mock<
IAuthorizationPolicyProvider
>();
496
var
policyProvider = Mock.Of<
IAuthorizationPolicyProvider
>();
553
.AddSingleton<
IAuthorizationPolicyProvider
>(policyProvider)
Microsoft.AspNetCore.Mvc.RazorPages (2)
ApplicationModels\AuthorizationPageApplicationModelProvider.cs (2)
13
private readonly
IAuthorizationPolicyProvider
_policyProvider;
17
IAuthorizationPolicyProvider
policyProvider,
Microsoft.AspNetCore.SignalR.Core (2)
Internal\DefaultHubDispatcher.cs (2)
679
var
policyProvider = provider.GetRequiredService<
IAuthorizationPolicyProvider
>();