2 types derived from ClaimsIdentity
System.Security.Claims (1)
System.Security.Principal.Windows (1)
40 instantiations of ClaimsIdentity
Aspire.Dashboard (9)
Aspire.Dashboard.Tests (7)
Aspire.Hosting (1)
Microsoft.AspNetCore.Authentication (1)
Microsoft.AspNetCore.Authentication.Cookies (2)
Microsoft.AspNetCore.Authentication.OAuth (1)
Microsoft.AspNetCore.Authorization.Policy (1)
Microsoft.AspNetCore.Components.Server (1)
Microsoft.AspNetCore.Http (1)
Microsoft.AspNetCore.Identity (3)
Microsoft.Extensions.Identity.Core (1)
System.Security.Claims (12)
System\Security\Claims\ClaimsIdentity.cs (8)
64/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
75/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
96/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
107/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
119/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
132/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
458return new ClaimsIdentity(this, _stringComparison);
820_actor = new ClaimsIdentity(reader);
236 references to ClaimsIdentity
Aspire.Dashboard (13)
Aspire.Dashboard.Tests (7)
dotnet-svcutil-lib (1)
Microsoft.AspNetCore.Antiforgery (9)
Microsoft.AspNetCore.Authentication (19)
TicketSerializer.cs (17)
73foreach (var identity in principal.Identities)
85/// <param name="identity">The <see cref="ClaimsIdentity" />.</param>
86protected virtual void WriteIdentity(BinaryWriter writer, ClaimsIdentity identity)
94WriteWithDefault(writer, identity.NameClaimType, ClaimsIdentity.DefaultNameClaimType);
95WriteWithDefault(writer, identity.RoleClaimType, ClaimsIdentity.DefaultRoleClaimType);
137WriteWithDefault(writer, claim.Type, claim.Subject?.NameClaimType ?? ClaimsIdentity.DefaultNameClaimType);
140WriteWithDefault(writer, claim.Issuer, ClaimsIdentity.DefaultIssuer);
177var identities = new ClaimsIdentity[count];
189/// Reads a <see cref="ClaimsIdentity"/> from a <see cref="BinaryReader"/>.
192/// <returns>The read <see cref="ClaimsIdentity"/>.</returns>
193protected virtual ClaimsIdentity ReadIdentity(BinaryReader reader)
198var nameClaimType = ReadWithDefault(reader, ClaimsIdentity.DefaultNameClaimType);
199var roleClaimType = ReadWithDefault(reader, ClaimsIdentity.DefaultRoleClaimType);
205var identity = new ClaimsIdentity(authenticationType, nameClaimType, roleClaimType);
235/// <param name="identity">The <see cref="ClaimsIdentity"/> to add the claim to.</param>
237protected virtual Claim ReadClaim(BinaryReader reader, ClaimsIdentity identity)
245var issuer = ReadWithDefault(reader, ClaimsIdentity.DefaultIssuer);
Microsoft.AspNetCore.Authentication.Abstractions (3)
Microsoft.AspNetCore.Authentication.Cookies (1)
Microsoft.AspNetCore.Authentication.OAuth (14)
Microsoft.AspNetCore.Authorization (1)
Microsoft.AspNetCore.Authorization.Policy (2)
Microsoft.AspNetCore.Components.Authorization (3)
Microsoft.AspNetCore.Http.Connections (4)
Microsoft.AspNetCore.Identity (3)
Microsoft.AspNetCore.Mvc.Core (2)
Microsoft.Extensions.Identity.Core (10)
mscorlib (1)
netstandard (1)
System.Security.Claims (138)
System\Security\Claims\Claim.cs (42)
36private readonly ClaimsIdentity? _subject;
57/// <param name="subject"> the value for <see cref="Claim.Subject"/>, which is the <see cref="ClaimsIdentity"/> that has these claims.</param>
59public Claim(BinaryReader reader, ClaimsIdentity? subject)
72_type = ClaimsIdentity.DefaultNameClaimType;
76_type = ClaimsIdentity.DefaultRoleClaimType;
101_issuer = ClaimsIdentity.DefaultIssuer;
115_originalIssuer = ClaimsIdentity.DefaultIssuer;
148/// <see cref="Claim.Issuer"/> is set to <see cref="ClaimsIdentity.DefaultIssuer"/>,
150/// <see cref="Claim.OriginalIssuer"/> is set to <see cref="ClaimsIdentity.DefaultIssuer"/>, and
153/// <seealso cref="ClaimsIdentity"/>
157: this(type, value, ClaimValueTypes.String, ClaimsIdentity.DefaultIssuer, ClaimsIdentity.DefaultIssuer, (ClaimsIdentity?)null)
169/// <see cref="Claim.Issuer"/> is set to <see cref="ClaimsIdentity.DefaultIssuer"/>,
170/// <see cref="Claim.OriginalIssuer"/> is set to <see cref="ClaimsIdentity.DefaultIssuer"/>,
173/// <seealso cref="ClaimsIdentity"/>
177: this(type, value, valueType, ClaimsIdentity.DefaultIssuer, ClaimsIdentity.DefaultIssuer, (ClaimsIdentity?)null)
187/// <param name="issuer">The claim issuer. If this parameter is empty or null, then <see cref="ClaimsIdentity.DefaultIssuer"/> is used.</param>
193/// <seealso cref="ClaimsIdentity"/>
197: this(type, value, valueType, issuer, issuer, (ClaimsIdentity?)null)
207/// <param name="issuer">The claim issuer. If this parameter is empty or null, then <see cref="ClaimsIdentity.DefaultIssuer"/> is used.</param>
213/// <seealso cref="ClaimsIdentity"/>
217: this(type, value, valueType, issuer, originalIssuer, (ClaimsIdentity?)null)
227/// <param name="issuer">The claim issuer. If this parameter is empty or null, then <see cref="ClaimsIdentity.DefaultIssuer"/> is used.</param>
231/// <seealso cref="ClaimsIdentity"/>
234public Claim(string type, string value, string? valueType, string? issuer, string? originalIssuer, ClaimsIdentity? subject)
246/// <param name="issuer">The claim issuer. If this parameter is empty or null, then <see cref="ClaimsIdentity.DefaultIssuer"/> is used.</param>
251internal Claim(string type, string value, string? valueType, string? issuer, string? originalIssuer, ClaimsIdentity? subject, string? propertyKey, string? propertyValue)
259_issuer = string.IsNullOrEmpty(issuer) ? ClaimsIdentity.DefaultIssuer : issuer;
277: this(other, (other == null ? (ClaimsIdentity?)null : other._subject))
285/// <param name="subject">the <see cref="ClaimsIdentity"/> to assign to <see cref="Claim.Subject"/>.</param>
288protected Claim(Claim other, ClaimsIdentity? subject)
349public ClaimsIdentity? Subject
385return Clone((ClaimsIdentity?)null);
391/// <param name="identity">the value for <see cref="Claim.Subject"/>, which is the <see cref="ClaimsIdentity"/> that has these claims.</param>
393public virtual Claim Clone(ClaimsIdentity? identity)
420if (string.Equals(_type, ClaimsIdentity.DefaultNameClaimType))
424else if (string.Equals(_type, ClaimsIdentity.DefaultRoleClaimType))
439if (!string.Equals(_issuer, ClaimsIdentity.DefaultIssuer, StringComparison.Ordinal))
449else if (!string.Equals(_originalIssuer, ClaimsIdentity.DefaultIssuer))
System\Security\Claims\ClaimsIdentity.cs (51)
33private ClaimsIdentity? _actor;
53/// Initializes an instance of <see cref="ClaimsIdentity"/>.
61/// Initializes an instance of <see cref="ClaimsIdentity"/>.
71/// Initializes an instance of <see cref="ClaimsIdentity"/>.
83/// Initializes an instance of <see cref="ClaimsIdentity"/>.
92/// Initializes an instance of <see cref="ClaimsIdentity"/>.
103/// Initializes an instance of <see cref="ClaimsIdentity"/>.
114/// Initializes an instance of <see cref="ClaimsIdentity"/>.
117/// <param name="nameType">The <see cref="Claim.Type"/> used when obtaining the value of <see cref="ClaimsIdentity.Name"/>.</param>
126/// Initializes an instance of <see cref="ClaimsIdentity"/>.
130/// <param name="nameType">The <see cref="Claim.Type"/> used when obtaining the value of <see cref="ClaimsIdentity.Name"/>.</param>
139/// Initializes an instance of <see cref="ClaimsIdentity"/>.
144/// <param name="nameType">The <see cref="Claim.Type"/> used when obtaining the value of <see cref="ClaimsIdentity.Name"/>.</param>
146/// <remarks>If 'identity' is a <see cref="ClaimsIdentity"/>, then there are potentially multiple sources for AuthenticationType, NameClaimType, RoleClaimType.
151/// <exception cref="InvalidOperationException">if 'identity' is a <see cref="ClaimsIdentity"/> and <see cref="ClaimsIdentity.Actor"/> results in a circular reference back to 'this'.</exception>
154ClaimsIdentity? claimsIdentity = identity as ClaimsIdentity;
197/// Initializes an instance of <see cref="ClaimsIdentity"/> using a <see cref="BinaryReader"/>.
200/// <param name="reader">a <see cref="BinaryReader"/> pointing to a <see cref="ClaimsIdentity"/>.</param>
210/// Initializes an instance of <see cref="ClaimsIdentity" /> with the specified <see cref="BinaryReader" />.
212/// <param name="reader">A <see cref="BinaryReader" /> pointing to a <see cref="ClaimsIdentity" />.</param>
232/// <param name="other"><see cref="ClaimsIdentity"/> to copy.</param>
234protected ClaimsIdentity(ClaimsIdentity other)
241/// Initializes a new instance of the <see cref="ClaimsIdentity" /> class from an existing
242/// <see cref="ClaimsIdentity" /> instance.
244/// <param name="other">The <see cref="ClaimsIdentity" /> to copy.</param>
252protected ClaimsIdentity(ClaimsIdentity other, StringComparison stringComparison)
261/// Initializes a new instance of the <see cref="ClaimsIdentity" /> class.
273/// <paramref name="identity"/> is a <see cref="ClaimsIdentity"/> and <see cref="Actor" />
297/// Initializes an instance of <see cref="ClaimsIdentity"/> from a serialized stream created via
312/// Gets the authentication type that can be used to determine how this <see cref="ClaimsIdentity"/> authenticated to an authority.
328/// Gets or sets a <see cref="ClaimsIdentity"/> that was granted delegation rights.
331public ClaimsIdentity? Actor
348/// Gets or sets a context that was used to create this <see cref="ClaimsIdentity"/>.
357/// Gets the claims as <see cref="IEnumerable{Claim}"/>, associated with this <see cref="ClaimsIdentity"/>.
404/// Allow the association of claims with this instance of <see cref="ClaimsIdentity"/>.
405/// The claims will not be serialized or added in Clone(). They will be included in searches, finds and returned from the call to <see cref="ClaimsIdentity.Claims"/>.
410/// Gets or sets the label for this <see cref="ClaimsIdentity"/>
419/// Gets the Name of this <see cref="ClaimsIdentity"/>.
438/// Gets the value that identifies 'Name' claims. This is used when returning the property <see cref="ClaimsIdentity.Name"/>.
454/// Creates a new instance of <see cref="ClaimsIdentity"/> with values copied from this object.
456public virtual ClaimsIdentity Clone()
736private void Initialize(ClaimsIdentity other)
760/// <param name="reader">a <see cref="BinaryReader"/> pointing to a <see cref="ClaimsIdentity"/>.</param>
789_nameClaimType = ClaimsIdentity.DefaultNameClaimType;
799_roleClaimType = ClaimsIdentity.DefaultRoleClaimType;
886if (!string.Equals(_nameClaimType, ClaimsIdentity.DefaultNameClaimType, StringComparison.Ordinal))
892if (!string.Equals(_roleClaimType, ClaimsIdentity.DefaultRoleClaimType, StringComparison.Ordinal))
977private bool IsCircular(ClaimsIdentity subject)
984ClaimsIdentity currSubject = subject;
System.Security.Principal.Windows (3)
System.ServiceModel.Primitives (1)