IAuthorizationHandlerContextFactory.CreateContext Method

Definition

Creates a AuthorizationHandlerContext used for authorization.

public:
 Microsoft::AspNetCore::Authorization::AuthorizationHandlerContext ^ CreateContext(System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Authorization::IAuthorizationRequirement ^> ^ requirements, System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource);
public Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext CreateContext (System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> requirements, System.Security.Claims.ClaimsPrincipal user, object resource);
public Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext CreateContext (System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> requirements, System.Security.Claims.ClaimsPrincipal user, object? resource);
abstract member CreateContext : seq<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> * System.Security.Claims.ClaimsPrincipal * obj -> Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext
Public Function CreateContext (requirements As IEnumerable(Of IAuthorizationRequirement), user As ClaimsPrincipal, resource As Object) As AuthorizationHandlerContext

Parameters

requirements
IEnumerable<IAuthorizationRequirement>

The requirements to evaluate.

user
ClaimsPrincipal

The user to evaluate the requirements against.

resource
Object

An optional resource the policy should be checked with. If a resource is not required for policy evaluation you may pass null as the value.

Returns

The AuthorizationHandlerContext.

Applies to