Sakura.AspNetCore.Extensions/Sakura.AspNetCore.Authentication.ExternalCookie/IdentityHelper.cs
/// <summary>
///     Create a new <see cref="ClaimsIdentity" /> based on a existing <see cref="ClaimsIdentity" /> with a new
///     authentication type.
/// </summary>
/// <param name="identity">The identity to be cloned.</param>
/// <param name="authenticationType">The authentication type of the new identity.</param>
/// <returns>The cloned new identity.</returns>
/// <exception cref="ArgumentNullException">
///     The <paramref name="identity" /> or <paramref name="authenticationType" /> is
///     <c>null</c>.
/// </exception>
Create a new  based on a existing  with a new
authentication type.
Create a new based on a existing with a new authentication type .
public static ClaimsIdentity CloneAs(this ClaimsIdentity identity, string authenticationType)
		{
			if (identity == null)
				throw new ArgumentNullException(nameof(identity));
			if (authenticationType == null)
				throw new ArgumentNullException(nameof(authenticationType));
			return new ClaimsIdentity(identity.Claims, authenticationType, identity.NameClaimType,
				identity.RoleClaimType);
		}
public static ClaimsIdentity CloneAs ( this ClaimsIdentity identity , string authenticationType ) { if ( identity == null ) throw new ArgumentNullException ( nameof ( identity ) ) ; if ( authenticationType == null ) throw new ArgumentNullException ( nameof ( authenticationType ) ) ; return new ClaimsIdentity ( identity . Claims , authenticationType , identity . NameClaimType , identity . RoleClaimType ) ; }
Create a new  based on a existing  with a new
authentication type.
Create a new based on a existing with a new authentication type .
The cloned new identity.
The cloned new identity .
The  or  is
null
The or is null
ClaimsIdentity
this
authenticationType
string
The authentication type of the new identity.
The authentication type of the new identity .
identity
The identity to be cloned.
The identity to be cloned .