Show / Hide Table of Contents

Class BaseClaimFilter<TUser>

Represents a claim filter that removes claims from Principal.

Inheritance
Object
BaseClaimFilter<TUser>
CommonMappingClaimFilter<TUser>
ConfirmEmailClaimFilter<TUser>
CopySessionIdClaimFilter<TUser>
EnsureNameClaimFilter<TUser>
Inherited Members
Object.Equals(Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: IRM.AspNetCore.Identity
Assembly: IRM.AspNetCore.Identity.dll
Syntax
public abstract class BaseClaimFilter<TUser> : IClaimFilter<TUser> where TUser : class, IUser
Type Parameters
TUser

Properties

Order

Gets or sets the order value for determining the order of execution of filters. Filters execute in ascending numeric value of the Order property.

Declaration
public int Order { get; set; }
Property Value
System.Int32

Implements
IClaimFilter<TUser>.Order
Remarks

Filters are executed in an ordering determined by an ascending sort of the Order property.

If two filters have the same numeric value of Order, then their relative execution order is in the order they are registered.

Methods

AddClaim(ClaimFilterContext<TUser>, Claim, Boolean)

Adds claim to the Principal nad optionally to the user.

Declaration
protected void AddClaim(ClaimFilterContext<TUser> context, Claim claim, bool addToUser = false)
Parameters
ClaimFilterContext<TUser> context

The ClaimFilterContext<TUser>.

System.Security.Claims.Claim claim

The System.Security.Claims.Claim to add.

Boolean addToUser

true if the claim should be added to the user; otherwise false.

ExecuteAsync(ClaimFilterContext<TUser>, CancellationToken)

Executes the filter to allow for manipulation of the claims for the current sign-in.

Declaration
public abstract Task ExecuteAsync(ClaimFilterContext<TUser> context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
ClaimFilterContext<TUser> context

The ClaimFilterContext<TUser> with information about the on-going sign-in.

System.Threading.CancellationToken cancellationToken

The System.Threading.CancellationToken used to propagate notifications that the operation should be canceled.

Returns
System.Threading.Tasks.Task

The System.Threading.Tasks.Task that represents the asynchronous operation.

Implements
IClaimFilter<TUser>.ExecuteAsync(ClaimFilterContext<TUser>, CancellationToken)

RemoveClaim(ClaimFilterContext<TUser>, String, Boolean)

Removes the first claim from the System.Security.Claims.ClaimsPrincipal and optionally from the user.

Declaration
protected void RemoveClaim(ClaimFilterContext<TUser> context, string claimType, bool removeFromUser = false)
Parameters
ClaimFilterContext<TUser> context

The ClaimFilterContext<TUser>.

String claimType

The type of claim to remove.

Boolean removeFromUser

true if the claim should be removed from the user; otherwise false.

Back to top Generated by DocFX