Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Security.​Principal.​GenericIdentity

Assembly: System.Security.Claims

Inheritance: object → Claims.​ClaimsIdentity → GenericIdentity

Implemented Interfaces

Represents a generic user.

Properties

public string
AuthenticationType
Gets the type of authentication used to identify the user.
Gets all claims for the user represented by this generic identity.
public bool
IsAuthenticated
Gets a value indicating whether the user has been authenticated.
public string
Name
Gets the user's name.
Gets or sets the identity of the calling party that was granted delegation rights.
public object
BootstrapContext
Gets or sets the token that was used to create this claims identity.
protected byte[]
CustomSerializationData
Contains any additional data provided by a derived type. Typically set when calling <see cref="M:System.Security.Claims.ClaimsIdentity.WriteTo(System.IO.BinaryWriter,System.Byte[])" /> .
public string
Label
Gets or sets the label for this claims identity.
public string
NameClaimType
Gets the claim type that is used to determine which claims provide the value for the <see cref="P:System.Security.Claims.ClaimsIdentity.Name" /> property of this claims identity.
public string
RoleClaimType
Gets the claim type that will be interpreted as a .NET role among the claims in this claims identity.

Methods

Clone​()
Creates a new object that is a copy of the current instance.
Returns A copy of the current instance.
public void
AddClaim​(Claims.​Claim claim)
Inherited from Claims.​ClaimsIdentity
Adds a single claim to this claims identity.
claim The claim to add.
public void
AddClaims​(Collections.​Generic.​IEnumerable<​Claims.​Claim> claims)
Inherited from Claims.​ClaimsIdentity
Adds a list of claims to this claims identity.
claims The claims to add.
protected Claims.​Claim
CreateClaim​(IO.​BinaryReader reader)
Inherited from Claims.​ClaimsIdentity
Provides an extensibility point for derived types to create a custom <see cref="T:System.Security.Claims.Claim" /> .
Returns A new <see cref="T:System.Security.Claims.Claim" /> .
reader The <see cref="T:System.IO.BinaryReader" /> that points to the claim.
FindAll​(Predicate<​Claims.​Claim> match)
Inherited from Claims.​ClaimsIdentity
Retrieves all of the claims that are matched by the specified predicate.
Returns The matching claims. The list is read-only.
match The function that performs the matching logic.
FindAll​(string type)
Inherited from Claims.​ClaimsIdentity
Retrieves all of the claims that have the specified claim type.
Returns The matching claims. The list is read-only.
type The claim type against which to match claims.
FindFirst​(Predicate<​Claims.​Claim> match)
Inherited from Claims.​ClaimsIdentity
Retrieves the first claim that is matched by the specified predicate.
Returns The first matching claim or <see langword="null" /> if no match is found.
match The function that performs the matching logic.
FindFirst​(string type)
Inherited from Claims.​ClaimsIdentity
Retrieves the first claim with the specified claim type.
Returns The first matching claim or <see langword="null" /> if no match is found.
type The claim type to match.
protected void
GetObjectData​(Runtime.​Serialization.​SerializationInfo info, Runtime.​Serialization.​StreamingContext context)
Inherited from Claims.​ClaimsIdentity
Populates the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with data needed to serialize the current <see cref="T:System.Security.Claims.ClaimsIdentity" /> object.
info The object to populate with data.
context The destination for this serialization. Can be <see langword="null" /> .
public bool
HasClaim​(Predicate<​Claims.​Claim> match)
Inherited from Claims.​ClaimsIdentity
Determines whether this claims identity has a claim that is matched by the specified predicate.
Returns <see langword="true" /> if a matching claim exists; otherwise, <see langword="false" /> .
match The function that performs the matching logic.
public bool
HasClaim​(string type, string value)
Inherited from Claims.​ClaimsIdentity
Determines whether this claims identity has a claim with the specified claim type and value.
Returns <see langword="true" /> if a match is found; otherwise, <see langword="false" /> .
type The type of the claim to match.
value The value of the claim to match.
public void
RemoveClaim​(Claims.​Claim claim)
Inherited from Claims.​ClaimsIdentity
Attempts to remove a claim from the claims identity.
claim The claim to remove.
public bool
TryRemoveClaim​(Claims.​Claim claim)
Inherited from Claims.​ClaimsIdentity
Attempts to remove a claim from the claims identity.
Returns <see langword="true" /> if the claim was successfully removed; otherwise, <see langword="false" /> .
claim The claim to remove.
public void
WriteTo​(IO.​BinaryWriter writer)
Inherited from Claims.​ClaimsIdentity
Serializes using a <see cref="T:System.IO.BinaryWriter" /> .
writer The writer to use for data storage.
protected void
WriteTo​(IO.​BinaryWriter writer, byte[] userData)
Inherited from Claims.​ClaimsIdentity
Serializes using a <see cref="T:System.IO.BinaryWriter" /> .
writer The writer to use for data storage.
userData Additional data provided by the derived type.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object