C# Класс System.Security.Claims.ClaimsIdentity

Наследование: System.Security.Principal.IIdentity
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
AddClaim void
AddClaims void
ClaimsIdentity System.Collections.Generic
Deserialize void
Initialize void
IsCircular bool
OnDeserializedMethod void
OnSerializingMethod void
RemoveClaim void
SafeAddClaim void
SafeAddClaims void
TryRemoveClaim bool

Открытые методы

Метод Описание
AddClaim ( Claim claim ) : void

Adds a single Claim to an internal list.

If Claim.Subject != this, then Claim.Clone(this) is called before the claim is added.

AddClaims ( IEnumerable claims ) : void

Adds a IEnumerable{Claim} to the internal list.

Each claim is examined and if Claim.Subject != this, then then Claim.Clone(this) is called before the claim is added.

ClaimsIdentity ( )
ClaimsIdentity ( System reader )
ClaimsIdentity ( System identity, System claims )
ClaimsIdentity ( System identity, System claims, string authenticationType, string nameType, string roleType )
ClaimsIdentity ( System claims )
ClaimsIdentity ( System claims, string authenticationType )
ClaimsIdentity ( System claims, string authenticationType, string nameType, string roleType )
ClaimsIdentity ( string authenticationType )
ClaimsIdentity ( string authenticationType, string nameType, string roleType )
ClaimsIdentity ( ) : System.Collections.Generic

Initializes an instance of ClaimsIdentity.

ClaimsIdentity ( BinaryReader reader ) : System.Collections.Generic

Initializes an instance of ClaimsIdentity using a BinaryReader. Normally the BinaryReader is constructed using the bytes from WriteTo(BinaryWriter) and initialized in the same way as the BinaryWriter.

ClaimsIdentity ( IEnumerable claims ) : System.Collections.Generic

Initializes an instance of ClaimsIdentity.

ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string) for details on how internal values are set.

ClaimsIdentity ( IEnumerable claims, string authenticationType ) : System.Collections.Generic

Initializes an instance of ClaimsIdentity.

ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string) for details on how internal values are set.

ClaimsIdentity ( IEnumerable claims, string authenticationType, string nameType, string roleType ) : System.Collections.Generic

Initializes an instance of ClaimsIdentity.

ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string) for details on how internal values are set.

ClaimsIdentity ( IIdentity identity ) : System.Collections.Generic

Initializes an instance of ClaimsIdentity.

ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string) for details on how internal values are set.

ClaimsIdentity ( IIdentity identity, IEnumerable claims ) : System.Collections.Generic

Initializes an instance of ClaimsIdentity.

ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string) for details on how internal values are set.

ClaimsIdentity ( IIdentity identity, IEnumerable claims, string authenticationType, string nameType, string roleType ) : System.Collections.Generic

Initializes an instance of ClaimsIdentity.

If 'identity' is a ClaimsIdentity, then there are potentially multiple sources for AuthenticationType, NameClaimType, RoleClaimType.

Priority is given to the parameters: authenticationType, nameClaimType, roleClaimType.

All Claims are copied into this instance in a List{Claim}. Each Claim is examined and if Claim.Subject != this, then Claim.Clone(this) is called before the claim is added.

Any 'External' claims are ignored.

ClaimsIdentity ( string authenticationType ) : System.Collections.Generic

Initializes an instance of ClaimsIdentity.

ClaimsIdentity ( string authenticationType, string nameType, string roleType ) : System.Collections.Generic

Initializes an instance of ClaimsIdentity.

ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string) for details on how internal values are set.

Clone ( ) : ClaimsIdentity

Creates a new instance of ClaimsIdentity with values copied from this object.

Clone ( ) : System.Security.Claims.ClaimsIdentity
FindAll ( Predicate match ) : IEnumerable

Retrieves a IEnumerable{Claim} where each claim is matched by .

FindAll ( string type ) : IEnumerable

Retrieves a IEnumerable{Claim} where each Claim.Type equals type.

Comparison is: StringComparison.OrdinalIgnoreCase.<

FindAll ( System match ) : System.Collections.Generic.IEnumerable
FindAll ( string type ) : System.Collections.Generic.IEnumerable
FindFirst ( Predicate match ) : Claim

Retrieves the first Claim that is matched by .

FindFirst ( string type ) : Claim

Retrieves the first Claim where Claim.Type equals type.

Comparison is: StringComparison.OrdinalIgnoreCase.

FindFirst ( System match ) : System.Security.Claims.Claim
FindFirst ( string type ) : System.Security.Claims.Claim
HasClaim ( Predicate match ) : bool

Determines if a claim is contained within this ClaimsIdentity.

HasClaim ( System match ) : bool
HasClaim ( string type, string value ) : bool

Determines if a claim with type AND value is contained within this ClaimsIdentity.

Comparison is: StringComparison.OrdinalIgnoreCase for Claim.Type, StringComparison.Ordinal for Claim.Value.

RemoveClaim ( Claim claim ) : void It is possible that a Claim returned from Claims cannot be removed. This would be the case for 'External' claims that are provided by reference.

object.ReferenceEquals is used to 'match'.

TryRemoveClaim ( Claim claim ) : bool It is possible that a Claim returned from Claims cannot be removed. This would be the case for 'External' claims that are provided by reference.

object.ReferenceEquals is used to 'match'.

WriteTo ( BinaryWriter writer ) : void

Serializes using a BinaryWriter

WriteTo ( System writer ) : void

Защищенные методы

Метод Описание
ClaimsIdentity ( System info, System context )
ClaimsIdentity ( ClaimsIdentity other ) : System.Collections.Generic

Copy constructor.

ClaimsIdentity ( SerializationInfo info, StreamingContext context ) : System.Collections.Generic
CreateClaim ( BinaryReader reader ) : Claim

Provides and extensibility point for derived types to create a custom Claim.

CreateClaim ( System reader ) : System.Security.Claims.Claim
GetObjectData ( SerializationInfo info, StreamingContext context ) : void

Populates the specified SerializationInfo with the serialization data for the ClaimsIdentity

GetObjectData ( System info, System context ) : void
WriteTo ( BinaryWriter writer, byte userData ) : void

Serializes using a BinaryWriter

WriteTo ( System writer, byte userData ) : void

Приватные методы

Метод Описание
AddClaim ( System claim ) : void
AddClaims ( System claims ) : void
ClaimsIdentity ( SerializationInfo info ) : System.Collections.Generic
Deserialize ( SerializationInfo info, StreamingContext context, bool useContext ) : void
Initialize ( BinaryReader reader ) : void

Initializes from a BinaryReader. Normally the reader is initialized with the results from WriteTo(BinaryWriter) Normally the BinaryReader is initialized in the same way as the BinaryWriter passed to WriteTo(BinaryWriter).

IsCircular ( ClaimsIdentity subject ) : bool

Checks if a circular reference exists to 'this'

OnDeserializedMethod ( StreamingContext context ) : void
OnSerializingMethod ( StreamingContext context ) : void
RemoveClaim ( System claim ) : void
SafeAddClaim ( Claim claim ) : void

Adds claim to intenal list. Calling Claim.Clone if Claim.Subject != this.

private only call from constructor, adds to internal list.

SafeAddClaims ( IEnumerable claims ) : void

Adds claims to intenal list. Calling Claim.Clone if Claim.Subject != this.

private only call from constructor, adds to internal list.

TryRemoveClaim ( System claim ) : bool

Описание методов

AddClaim() публичный Метод

Adds a single Claim to an internal list.
If Claim.Subject != this, then Claim.Clone(this) is called before the claim is added.
if 'claim' is null.
public AddClaim ( Claim claim ) : void
claim Claim the add.
Результат void

AddClaims() публичный Метод

Adds a IEnumerable{Claim} to the internal list.
Each claim is examined and if Claim.Subject != this, then then Claim.Clone(this) is called before the claim is added.
if 'claims' is null.
public AddClaims ( IEnumerable claims ) : void
claims IEnumerable Enumeration of claims to add.
Результат void

ClaimsIdentity() публичный Метод

public ClaimsIdentity ( )

ClaimsIdentity() публичный Метод

public ClaimsIdentity ( System reader )
reader System

ClaimsIdentity() защищенный Метод

protected ClaimsIdentity ( System info, System context )
info System
context System

ClaimsIdentity() публичный Метод

public ClaimsIdentity ( System identity, System claims )
identity System
claims System

ClaimsIdentity() публичный Метод

public ClaimsIdentity ( System identity, System claims, string authenticationType, string nameType, string roleType )
identity System
claims System
authenticationType string
nameType string
roleType string

ClaimsIdentity() публичный Метод

public ClaimsIdentity ( System claims )
claims System

ClaimsIdentity() публичный Метод

public ClaimsIdentity ( System claims, string authenticationType )
claims System
authenticationType string

ClaimsIdentity() публичный Метод

public ClaimsIdentity ( System claims, string authenticationType, string nameType, string roleType )
claims System
authenticationType string
nameType string
roleType string

ClaimsIdentity() публичный Метод

public ClaimsIdentity ( string authenticationType )
authenticationType string

ClaimsIdentity() публичный Метод

public ClaimsIdentity ( string authenticationType, string nameType, string roleType )
authenticationType string
nameType string
roleType string

ClaimsIdentity() публичный Метод

Initializes an instance of ClaimsIdentity.
public ClaimsIdentity ( ) : System.Collections.Generic
Результат System.Collections.Generic

ClaimsIdentity() публичный Метод

Initializes an instance of ClaimsIdentity using a BinaryReader. Normally the BinaryReader is constructed using the bytes from WriteTo(BinaryWriter) and initialized in the same way as the BinaryWriter.
if 'reader' is null.
public ClaimsIdentity ( BinaryReader reader ) : System.Collections.Generic
reader BinaryReader a pointing to a .
Результат System.Collections.Generic

ClaimsIdentity() защищенный Метод

Copy constructor.
if 'other' is null.
protected ClaimsIdentity ( ClaimsIdentity other ) : System.Collections.Generic
other ClaimsIdentity to copy.
Результат System.Collections.Generic

ClaimsIdentity() публичный Метод

Initializes an instance of ClaimsIdentity.
ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string) for details on how internal values are set.
public ClaimsIdentity ( IEnumerable claims ) : System.Collections.Generic
claims IEnumerable associated with this instance.
Результат System.Collections.Generic

ClaimsIdentity() публичный Метод

Initializes an instance of ClaimsIdentity.
ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string) for details on how internal values are set.
public ClaimsIdentity ( IEnumerable claims, string authenticationType ) : System.Collections.Generic
claims IEnumerable associated with this instance.
authenticationType string The authentication method used to establish this identity.
Результат System.Collections.Generic

ClaimsIdentity() публичный Метод

Initializes an instance of ClaimsIdentity.
ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string) for details on how internal values are set.
public ClaimsIdentity ( IEnumerable claims, string authenticationType, string nameType, string roleType ) : System.Collections.Generic
claims IEnumerable associated with this instance.
authenticationType string The type of authentication used.
nameType string The used when obtaining the value of .
roleType string The used when performing logic for .
Результат System.Collections.Generic

ClaimsIdentity() публичный Метод

Initializes an instance of ClaimsIdentity.
ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string) for details on how internal values are set.
public ClaimsIdentity ( IIdentity identity ) : System.Collections.Generic
identity IIdentity supplies the and .
Результат System.Collections.Generic

ClaimsIdentity() публичный Метод

Initializes an instance of ClaimsIdentity.
ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string) for details on how internal values are set.
public ClaimsIdentity ( IIdentity identity, IEnumerable claims ) : System.Collections.Generic
identity IIdentity supplies the and .
claims IEnumerable associated with this instance.
Результат System.Collections.Generic

ClaimsIdentity() публичный Метод

Initializes an instance of ClaimsIdentity.
If 'identity' is a ClaimsIdentity, then there are potentially multiple sources for AuthenticationType, NameClaimType, RoleClaimType.

Priority is given to the parameters: authenticationType, nameClaimType, roleClaimType.

All Claims are copied into this instance in a List{Claim}. Each Claim is examined and if Claim.Subject != this, then Claim.Clone(this) is called before the claim is added.

Any 'External' claims are ignored.

if 'identity' is a and results in a circular refrence back to 'this'.
public ClaimsIdentity ( IIdentity identity, IEnumerable claims, string authenticationType, string nameType, string roleType ) : System.Collections.Generic
identity IIdentity supplies the and .
claims IEnumerable associated with this instance.
authenticationType string The type of authentication used.
nameType string The used when obtaining the value of .
roleType string The used when performing logic for .
Результат System.Collections.Generic

ClaimsIdentity() защищенный Метод

protected ClaimsIdentity ( SerializationInfo info, StreamingContext context ) : System.Collections.Generic
info SerializationInfo
context StreamingContext
Результат System.Collections.Generic

ClaimsIdentity() публичный Метод

Initializes an instance of ClaimsIdentity.
public ClaimsIdentity ( string authenticationType ) : System.Collections.Generic
authenticationType string The authentication method used to establish this identity.
Результат System.Collections.Generic

ClaimsIdentity() публичный Метод

Initializes an instance of ClaimsIdentity.
ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string) for details on how internal values are set.
public ClaimsIdentity ( string authenticationType, string nameType, string roleType ) : System.Collections.Generic
authenticationType string The type of authentication used.
nameType string The used when obtaining the value of .
roleType string The used when performing logic for .
Результат System.Collections.Generic

Clone() публичный Метод

Creates a new instance of ClaimsIdentity with values copied from this object.
public Clone ( ) : ClaimsIdentity
Результат ClaimsIdentity

Clone() публичный Метод

public Clone ( ) : System.Security.Claims.ClaimsIdentity
Результат System.Security.Claims.ClaimsIdentity

CreateClaim() защищенный Метод

Provides and extensibility point for derived types to create a custom Claim.
protected CreateClaim ( BinaryReader reader ) : Claim
reader BinaryReader the that points at the claim.
Результат Claim

CreateClaim() защищенный Метод

protected CreateClaim ( System reader ) : System.Security.Claims.Claim
reader System
Результат System.Security.Claims.Claim

FindAll() публичный Метод

Retrieves a IEnumerable{Claim} where each claim is matched by .
if 'match' is null.
public FindAll ( Predicate match ) : IEnumerable
match Predicate The function that performs the matching logic.
Результат IEnumerable

FindAll() публичный Метод

Retrieves a IEnumerable{Claim} where each Claim.Type equals type.
Comparison is: StringComparison.OrdinalIgnoreCase.<
if 'type' is null.
public FindAll ( string type ) : IEnumerable
type string The type of the claim to match.
Результат IEnumerable

FindAll() публичный Метод

public FindAll ( System match ) : System.Collections.Generic.IEnumerable
match System
Результат System.Collections.Generic.IEnumerable

FindAll() публичный Метод

public FindAll ( string type ) : System.Collections.Generic.IEnumerable
type string
Результат System.Collections.Generic.IEnumerable

FindFirst() публичный Метод

Retrieves the first Claim that is matched by .
if 'match' is null.
public FindFirst ( Predicate match ) : Claim
match Predicate The function that performs the matching logic.
Результат Claim

FindFirst() публичный Метод

Retrieves the first Claim where Claim.Type equals type.
Comparison is: StringComparison.OrdinalIgnoreCase.
if 'type' is null.
public FindFirst ( string type ) : Claim
type string The type of the claim to match.
Результат Claim

FindFirst() публичный Метод

public FindFirst ( System match ) : System.Security.Claims.Claim
match System
Результат System.Security.Claims.Claim

FindFirst() публичный Метод

public FindFirst ( string type ) : System.Security.Claims.Claim
type string
Результат System.Security.Claims.Claim

GetObjectData() защищенный Метод

Populates the specified SerializationInfo with the serialization data for the ClaimsIdentity
Thrown if the info parameter is null.
protected GetObjectData ( SerializationInfo info, StreamingContext context ) : void
info SerializationInfo The serialization information stream to write to. Satisfies ISerializable contract.
context StreamingContext Context for serialization. Can be null.
Результат void

GetObjectData() защищенный Метод

protected GetObjectData ( System info, System context ) : void
info System
context System
Результат void

HasClaim() публичный Метод

Determines if a claim is contained within this ClaimsIdentity.
if 'match' is null.
public HasClaim ( Predicate match ) : bool
match Predicate The function that performs the matching logic.
Результат bool

HasClaim() публичный Метод

public HasClaim ( System match ) : bool
match System
Результат bool

HasClaim() публичный Метод

Determines if a claim with type AND value is contained within this ClaimsIdentity.
Comparison is: StringComparison.OrdinalIgnoreCase for Claim.Type, StringComparison.Ordinal for Claim.Value.
if 'type' is null. if 'value' is null.
public HasClaim ( string type, string value ) : bool
type string the type of the claim to match.
value string the value of the claim to match.
Результат bool

RemoveClaim() публичный Метод

It is possible that a Claim returned from Claims cannot be removed. This would be the case for 'External' claims that are provided by reference.

object.ReferenceEquals is used to 'match'.

if 'claim' cannot be removed.
public RemoveClaim ( Claim claim ) : void
claim Claim the to match.
Результат void

TryRemoveClaim() публичный Метод

It is possible that a Claim returned from Claims cannot be removed. This would be the case for 'External' claims that are provided by reference.

object.ReferenceEquals is used to 'match'.

public TryRemoveClaim ( Claim claim ) : bool
claim Claim the to match.
Результат bool

WriteTo() публичный Метод

Serializes using a BinaryWriter
if 'writer' is null.
public WriteTo ( BinaryWriter writer ) : void
writer BinaryWriter the to use for data storage.
Результат void

WriteTo() защищенный Метод

Serializes using a BinaryWriter
if 'writer' is null.
protected WriteTo ( BinaryWriter writer, byte userData ) : void
writer BinaryWriter the to use for data storage.
userData byte additional data provided by derived type.
Результат void

WriteTo() публичный Метод

public WriteTo ( System writer ) : void
writer System
Результат void

WriteTo() защищенный Метод

protected WriteTo ( System writer, byte userData ) : void
writer System
userData byte
Результат void