Skip to content

DapperMaticRoleSource ​

Namespace: MJCZone.DapperMatic.AspNetCore.Authentication

Assembly: MJCZone.DapperMatic.AspNetCore

Summary ​

Where a caller's roles are found besides ASP.NET Core's role claim: a claim of another type (each value a role, or one value holding a JSON array of them), a path into a claim holding JSON (Keycloak's <c>realm_access</c>), or code. The roles of every source add up; policies' roles are matched against them as against the role claim.

sealed public

Contents ​

Constructors (1) | Methods (4) | Properties (3)

Constructors ​

DapperMaticRoleSource ​

csharp
DapperMaticRoleSource()

Methods ​

GetType ​

csharp
GetType()

ToString ​

csharp
ToString()

Equals ​

csharp
Equals()

GetHashCode ​

csharp
GetHashCode()

Properties ​

ClaimType ​

Gets the claim type the roles are in, or null for a source in code.

Type: string?

JsonPath ​

Gets the path into the claim's JSON value the roles are at (<c>roles</c> for Keycloak's <c>realm_access</c>, dots between properties), or null when the claim's values are the roles.

Type: string?

Code ​

Gets the roles read by code: the request and its caller in, the roles out.

Type: Func&lt;HttpContext, ClaimsPrincipal, CancellationToken, ValueTask&lt;IEnumerable&lt;string&gt;&gt;&gt;