public ClaimsIdentity ( IIdentity identity, IEnumerable |
||
identity | IIdentity | |
claims | IEnumerable |
|
authenticationType | string | The type of authentication used. |
nameType | string | The |
roleType | string | The |
return | System.Collections.Generic |
public ClaimsIdentity(IIdentity identity, IEnumerable<Claim> claims, string authenticationType, string nameType, string roleType)
{
// TODO - brentsch, should we have another constructor that takes ClaimsIdentity thereby bypassing the cast below?
ClaimsIdentity claimsIdentity = identity as ClaimsIdentity;
_authenticationType = !string.IsNullOrWhiteSpace(authenticationType) ? authenticationType : (identity != null ? identity.AuthenticationType : null);
_nameClaimType = !string.IsNullOrEmpty(nameType) ? nameType : (claimsIdentity != null ? claimsIdentity._nameClaimType : DefaultNameClaimType);
_roleClaimType = !string.IsNullOrEmpty(roleType) ? roleType : (claimsIdentity != null ? claimsIdentity._roleClaimType : DefaultRoleClaimType);
if (claimsIdentity != null)
{
_label = claimsIdentity._label;
_bootstrapContext = claimsIdentity._bootstrapContext;
if (claimsIdentity.Actor != null)
{
//
// Check if the Actor is circular before copying. That check is done while setting
// the Actor property and so not really needed here. But checking just for sanity sake
//
if (!IsCircular(claimsIdentity.Actor))
{
_actor = claimsIdentity.Actor;
}
else
{
throw new InvalidOperationException(SR.GetResourceString("InvalidOperationException_ActorGraphCircular", "Actor cannot be set so that circular directed graph will exist chaining the subjects together."));
}
}
SafeAddClaims(claimsIdentity._instanceClaims);
}
else
{
if (identity != null && !string.IsNullOrEmpty(identity.Name))
{
SafeAddClaim(new Claim(_nameClaimType, identity.Name, ClaimValueTypes.String, DefaultIssuer, DefaultIssuer, this));
}
}
if (claims != null)
{
SafeAddClaims(claims);
}
}
ClaimsIdentity::ClaimsIdentity ( ) | |
ClaimsIdentity::ClaimsIdentity ( System reader ) | |
ClaimsIdentity::ClaimsIdentity ( System info, System context ) | |
ClaimsIdentity::ClaimsIdentity ( System identity, System |
|
ClaimsIdentity::ClaimsIdentity ( System identity, System |
|
ClaimsIdentity::ClaimsIdentity ( System |
|
ClaimsIdentity::ClaimsIdentity ( System |
|
ClaimsIdentity::ClaimsIdentity ( System |
|
ClaimsIdentity::ClaimsIdentity ( string authenticationType ) | |
ClaimsIdentity::ClaimsIdentity ( string authenticationType, string nameType, string roleType ) | |
ClaimsIdentity::ClaimsIdentity ( ) : System.Collections.Generic | |
ClaimsIdentity::ClaimsIdentity ( BinaryReader reader ) : System.Collections.Generic | |
ClaimsIdentity::ClaimsIdentity ( |
|
ClaimsIdentity::ClaimsIdentity ( IEnumerable |
|
ClaimsIdentity::ClaimsIdentity ( IEnumerable |
|
ClaimsIdentity::ClaimsIdentity ( IEnumerable |
|
ClaimsIdentity::ClaimsIdentity ( IIdentity identity ) : System.Collections.Generic | |
ClaimsIdentity::ClaimsIdentity ( IIdentity identity, IEnumerable |
|
ClaimsIdentity::ClaimsIdentity ( SerializationInfo info ) : System.Collections.Generic | |
ClaimsIdentity::ClaimsIdentity ( SerializationInfo info, StreamingContext context ) : System.Collections.Generic | |
ClaimsIdentity::ClaimsIdentity ( string authenticationType ) : System.Collections.Generic | |
ClaimsIdentity::ClaimsIdentity ( string authenticationType, string nameType, string roleType ) : System.Collections.Generic |