Show / Hide Table of Contents

Class ClaimsPrincipalExtensions

Extension methods for System.Security.Claims.ClaimsPrincipal.

Inheritance
Object
ClaimsPrincipalExtensions
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 static class ClaimsPrincipalExtensions

Methods

AddActClaim(ClaimsIdentity, ClaimsPrincipal, String[])

Creates an act claim from and adds it to identity.

Declaration
public static void AddActClaim(this ClaimsIdentity identity, ClaimsPrincipal from, params string[] claimTypesToInclude)
Parameters
System.Security.Claims.ClaimsIdentity identity

The System.Security.Claims.ClaimsIdentity to add the act claim to.

System.Security.Claims.ClaimsPrincipal from

The user to create a act claim for.

String[] claimTypesToInclude

The types of claims to include in the act claim.

CreateActClaim(ClaimsPrincipal, String[])

Creates a System.Security.Claims.Claim of type Actor with information from the principal.

Declaration
public static Claim CreateActClaim(this ClaimsPrincipal principal, params string[] claimTypesToInclude)
Parameters
System.Security.Claims.ClaimsPrincipal principal

The user to create a act claim for.

String[] claimTypesToInclude

The types of claims to include in the act claim.

Returns
System.Security.Claims.Claim

A System.Security.Claims.Claim of type Actor.

HasVerifiedEmail(ClaimsPrincipal)

Gets if the principal has a verified email or not.

Declaration
public static bool HasVerifiedEmail(this ClaimsPrincipal principal)
Parameters
System.Security.Claims.ClaimsPrincipal principal

The System.Security.Claims.ClaimsPrincipal to check.

Returns
Boolean

true if the principal has a verified email; otherwise false.

HasVerifiedPhoneNumber(ClaimsPrincipal)

Gets if the principal has a verified phone number or not.

Declaration
public static bool HasVerifiedPhoneNumber(this ClaimsPrincipal principal)
Parameters
System.Security.Claims.ClaimsPrincipal principal

The System.Security.Claims.ClaimsPrincipal to check.

Returns
Boolean

true if the principal has a verified phone number; otherwise false.

Back to top Generated by DocFX