58 instantiations of Claim
Aspire.Dashboard (11)
Aspire.Dashboard.Tests (2)
dotnet-user-jwts (6)
Microsoft.AspNetCore.Authentication (1)
Microsoft.AspNetCore.Authentication.Cookies (2)
Microsoft.AspNetCore.Authentication.OAuth (3)
Microsoft.AspNetCore.Identity (8)
SignInManager.cs (8)
255additionalClaims.Add(new Claim(ClaimTypes.AuthenticationMethod, authenticationMethod));
852new Claim("amr", "mfa")
857claims.Add(new Claim(ClaimTypes.AuthenticationMethod, twoFactorInfo.LoginProvider));
1180identity.AddClaim(new Claim(ClaimTypes.Name, userId));
1183identity.AddClaim(new Claim(ClaimTypes.AuthenticationMethod, loginProvider));
1192rememberBrowserIdentity.AddClaim(new Claim(ClaimTypes.Name, userId));
1196rememberBrowserIdentity.AddClaim(new Claim(Options.ClaimsIdentity.SecurityStampClaimType, stamp));
1253await SignInWithClaimsAsync(user, isPersistent, new Claim[] { new Claim("amr", "pwd") });
Microsoft.Extensions.Identity.Core (5)
Microsoft.Extensions.Identity.Stores (2)
System.Security.Claims (5)
System.Security.Principal.Windows (13)
System\Security\Principal\WindowsIdentity.cs (13)
1052_userClaims.Add(new Claim(NameClaimType, Name, ClaimValueTypes.String, _issuerName, _issuerName, this));
1117claim = new Claim(ClaimTypes.PrimaryGroupSid, groupSid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this);
1123claim = new Claim(ClaimTypes.GroupSid, groupSid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this);
1131claim = new Claim(ClaimTypes.DenyOnlyPrimaryGroupSid, groupSid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this);
1137claim = new Claim(ClaimTypes.DenyOnlySid, groupSid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this);
1170claim = new Claim(ClaimTypes.PrimarySid, sid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this);
1176claim = new Claim(ClaimTypes.DenyOnlyPrimarySid, sid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this);
1218Claim claim = new Claim(claimType, groupSid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this);
1226Claim claim = new Claim(claimType, groupSid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this);
1270Claim c = new Claim(name, Marshal.PtrToStringUni(stringPointers[item])!, ClaimValueTypes.String, _issuerName, _issuerName, this);
1282Claim c = new Claim(name, intValues[item].ToString(CultureInfo.InvariantCulture), ClaimValueTypes.Integer64, _issuerName, _issuerName, this);
1295Claim c = new Claim(name, ((ulong)uintValues[item]).ToString(CultureInfo.InvariantCulture), ClaimValueTypes.UInteger64, _issuerName, _issuerName, this);
1307Claim c = new Claim(
266 references to Claim
Aspire.Dashboard (1)
Microsoft.AspNetCore.Antiforgery (5)
Microsoft.AspNetCore.Authentication (7)
Microsoft.AspNetCore.Authentication.Cookies (1)
Microsoft.AspNetCore.Authentication.OAuth (3)
Microsoft.AspNetCore.Authorization (2)
Microsoft.AspNetCore.Components.Authorization (6)
Microsoft.AspNetCore.Identity (13)
Microsoft.Extensions.Identity.Core (37)
IUserClaimStore.cs (11)
18/// Gets a list of <see cref="Claim"/>s to be belonging to the specified <paramref name="user"/> as an asynchronous operation.
23/// A <see cref="Task{TResult}"/> that represents the result of the asynchronous query, a list of <see cref="Claim"/>s.
25Task<IList<Claim>> GetClaimsAsync(TUser user, CancellationToken cancellationToken);
31/// <param name="claims">The collection of <see cref="Claim"/>s to add.</param>
34Task AddClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken);
44Task ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken);
50/// <param name="claims">A collection of <see cref="Claim"/>s to remove.</param>
53Task RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken);
56/// Returns a list of users who contain the specified <see cref="Claim"/>.
64Task<IList<TUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken);
Microsoft.Extensions.Identity.Stores (16)
UserStoreBase.cs (7)
67protected virtual TUserClaim CreateUserClaim(TUser user, Claim claim)
358public abstract Task<IList<Claim>> GetClaimsAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken));
367public abstract Task AddClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken));
377public abstract Task ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken));
386public abstract Task RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken));
793public abstract Task<IList<TUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken));
mscorlib (1)
netstandard (1)
System.Security.Claims (147)
System\Security\Claims\Claim.cs (44)
42/// Initializes an instance of <see cref="Claim"/> using a <see cref="BinaryReader"/>.
45/// <param name="reader">a <see cref="BinaryReader"/> pointing to a <see cref="Claim"/>.</param>
53/// Initializes an instance of <see cref="Claim"/> using a <see cref="BinaryReader"/>.
56/// <param name="reader">a <see cref="BinaryReader"/> pointing to a <see cref="Claim"/>.</param>
57/// <param name="subject"> the value for <see cref="Claim.Subject"/>, which is the <see cref="ClaimsIdentity"/> that has these claims.</param>
142/// Creates a <see cref="Claim"/> with the specified type and value.
148/// <see cref="Claim.Issuer"/> is set to <see cref="ClaimsIdentity.DefaultIssuer"/>,
149/// <see cref="Claim.ValueType"/> is set to <see cref="ClaimValueTypes.String"/>,
150/// <see cref="Claim.OriginalIssuer"/> is set to <see cref="ClaimsIdentity.DefaultIssuer"/>, and
151/// <see cref="Claim.Subject"/> is set to null.
162/// Creates a <see cref="Claim"/> with the specified type, value, and value type.
169/// <see cref="Claim.Issuer"/> is set to <see cref="ClaimsIdentity.DefaultIssuer"/>,
170/// <see cref="Claim.OriginalIssuer"/> is set to <see cref="ClaimsIdentity.DefaultIssuer"/>,
171/// and <see cref="Claim.Subject"/> is set to null.
182/// Creates a <see cref="Claim"/> with the specified type, value, value type, and issuer.
190/// <see cref="Claim.OriginalIssuer"/> is set to value of the <paramref name="issuer"/> parameter,
191/// <see cref="Claim.Subject"/> is set to null.
202/// Creates a <see cref="Claim"/> with the specified type, value, value type, issuer and original issuer.
211/// <see cref="Claim.Subject"/> is set to null.
222/// Creates a <see cref="Claim"/> with the specified type, value, value type, issuer, original issuer and subject.
271/// Copy constructor for <see cref="Claim"/>
273/// <param name="other">the <see cref="Claim"/> to copy.</param>
274/// <remarks><see cref="Claim.Subject"/>will be set to 'null'.</remarks>
276protected Claim(Claim other)
282/// Copy constructor for <see cref="Claim"/>
284/// <param name="other">the <see cref="Claim"/> to copy.</param>
285/// <param name="subject">the <see cref="ClaimsIdentity"/> to assign to <see cref="Claim.Subject"/>.</param>
286/// <remarks><see cref="Claim.Subject"/>will be set to 'subject'.</remarks>
288protected Claim(Claim other, ClaimsIdentity? subject)
321/// Gets the issuer of the <see cref="Claim"/>.
329/// Gets the original issuer of the <see cref="Claim"/>.
342/// Gets the collection of Properties associated with the <see cref="Claim"/>.
347/// Gets the subject of the <see cref="Claim"/>.
355/// Gets the claim type of the <see cref="Claim"/>.
364/// Gets the value of the <see cref="Claim"/>.
372/// Gets the value type of the <see cref="Claim"/>.
381/// Creates a new instance <see cref="Claim"/> with values copied from this object.
383public virtual Claim Clone()
389/// Creates a new instance <see cref="Claim"/> with values copied from this object.
391/// <param name="identity">the value for <see cref="Claim.Subject"/>, which is the <see cref="ClaimsIdentity"/> that has these claims.</param>
392/// <remarks><see cref="Claim.Subject"/> will be set to 'identity'.</remarks>
393public virtual Claim Clone(ClaimsIdentity? identity)
511/// Returns a string representation of the <see cref="Claim"/> object.
516/// <returns>The string representation of the <see cref="Claim"/> object.</returns>
System\Security\Claims\ClaimsIdentity.cs (76)
36private List<List<Claim>>? _externalClaims;
38private readonly List<Claim> _instanceClaims = new List<Claim>();
56: this((IIdentity?)null, (IEnumerable<Claim>?)null, (string?)null, (string?)null, (string?)null)
64/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
66: this(identity, (IEnumerable<Claim>?)null, (string?)null, (string?)null, (string?)null)
75/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
77public ClaimsIdentity(IEnumerable<Claim>? claims)
87: this((IIdentity?)null, (IEnumerable<Claim>?)null, authenticationType, (string?)null, (string?)null)
96/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
97public ClaimsIdentity(IEnumerable<Claim>? claims, string? authenticationType)
107/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
108public ClaimsIdentity(IIdentity? identity, IEnumerable<Claim>? claims)
117/// <param name="nameType">The <see cref="Claim.Type"/> used when obtaining the value of <see cref="ClaimsIdentity.Name"/>.</param>
118/// <param name="roleType">The <see cref="Claim.Type"/> used when performing logic for <see cref="ClaimsPrincipal.IsInRole"/>.</param>
119/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
121: this((IIdentity?)null, (IEnumerable<Claim>?)null, authenticationType, nameType, roleType)
130/// <param name="nameType">The <see cref="Claim.Type"/> used when obtaining the value of <see cref="ClaimsIdentity.Name"/>.</param>
131/// <param name="roleType">The <see cref="Claim.Type"/> used when performing logic for <see cref="ClaimsPrincipal.IsInRole"/>.</param>
132/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
133public ClaimsIdentity(IEnumerable<Claim>? claims, string? authenticationType, string? nameType, string? roleType)
144/// <param name="nameType">The <see cref="Claim.Type"/> used when obtaining the value of <see cref="ClaimsIdentity.Name"/>.</param>
145/// <param name="roleType">The <see cref="Claim.Type"/> used when performing logic for <see cref="ClaimsPrincipal.IsInRole"/>.</param>
148/// <para>All <see cref="Claim"/>s are copied into this instance in a <see cref="List{Claim}"/>. Each Claim is examined and if Claim.Subject != this, then Claim.Clone(this) is called before the claim is added.</para>
152public ClaimsIdentity(IIdentity? identity, IEnumerable<Claim>? claims, string? authenticationType, string? nameType, string? roleType)
278IEnumerable<Claim>? claims = null,
360public virtual IEnumerable<Claim> Claims
373private IEnumerable<Claim> CombinedClaimsIterator()
384foreach (Claim claim in _externalClaims[j])
407internal List<List<Claim>> ExternalClaims => _externalClaims ??= new List<List<Claim>>();
421/// <remarks>Calls <see cref="FindFirst(string)"/> where string == NameClaimType, if found, returns <see cref="Claim.Value"/> otherwise null.</remarks>
427Claim? claim = FindFirst(_nameClaimType);
462/// Adds a single <see cref="Claim"/> to an internal list.
464/// <param name="claim">the <see cref="Claim"/>add.</param>
465/// <remarks>If <see cref="Claim.Subject"/> != this, then Claim.Clone(this) is called before the claim is added.</remarks>
467public virtual void AddClaim(Claim claim)
485/// <remarks>Each claim is examined and if <see cref="Claim.Subject"/> != this, then Claim.Clone(this) is called before the claim is added.</remarks>
487public virtual void AddClaims(IEnumerable<Claim?> claims)
491foreach (Claim? claim in claims)
510/// Attempts to remove a <see cref="Claim"/> the internal list.
512/// <param name="claim">the <see cref="Claim"/> to match.</param>
513/// <remarks> It is possible that a <see cref="Claim"/> returned from <see cref="Claims"/> cannot be removed. This would be the case for 'External' claims that are provided by reference.
516public virtual bool TryRemoveClaim(Claim? claim)
538/// Removes a <see cref="Claim"/> from the internal list.
540/// <param name="claim">the <see cref="Claim"/> to match.</param>
541/// <remarks> It is possible that a <see cref="Claim"/> returned from <see cref="Claims"/> cannot be removed. This would be the case for 'External' claims that are provided by reference.
545public virtual void RemoveClaim(Claim? claim)
558private void SafeAddClaims(IEnumerable<Claim?> claims)
560foreach (Claim? claim in claims)
580private void SafeAddClaim(Claim? claim)
601public virtual IEnumerable<Claim> FindAll(Predicate<Claim> match)
606IEnumerable<Claim> Core(Predicate<Claim> match)
608foreach (Claim claim in Claims)
624public virtual IEnumerable<Claim> FindAll(string type)
629IEnumerable<Claim> Core(string type)
631foreach (Claim claim in Claims)
645/// Retrieves the first <see cref="Claim"/> that is matched by <paramref name="match"/>.
648/// <returns>A <see cref="Claim"/>, null if nothing matches.</returns>
650public virtual Claim? FindFirst(Predicate<Claim> match)
654foreach (Claim claim in Claims)
666/// Retrieves the first <see cref="Claim"/> where Claim.Type equals <paramref name="type"/>.
669/// <returns>A <see cref="Claim"/>, null if nothing matches.</returns>
671public virtual Claim? FindFirst(string type)
675foreach (Claim claim in Claims)
695public virtual bool HasClaim(Predicate<Claim> match)
699foreach (Claim claim in Claims)
723foreach (Claim claim in Claims)
838/// Provides an extensibility point for derived types to create a custom <see cref="Claim"/>.
841/// <returns>a new <see cref="Claim"/>.</returns>
842protected virtual Claim CreateClaim(BinaryReader reader)
952foreach (var claim in _instanceClaims)
1014foreach (Claim item in Claims)
System.Security.Principal.Windows (26)
System\Security\Principal\WindowsIdentity.cs (22)
57private List<Claim>? _deviceClaims;
58private List<Claim>? _userClaims;
981public virtual IEnumerable<Claim> UserClaims
994public virtual IEnumerable<Claim> DeviceClaims
1008public override IEnumerable<Claim> Claims
1017foreach (Claim claim in base.Claims)
1020foreach (Claim claim in _userClaims!)
1023foreach (Claim claim in _deviceClaims!)
1042_userClaims = new List<Claim>();
1043_deviceClaims = new List<Claim>();
1083private unsafe void AddGroupSidClaims(List<Claim> instanceClaims)
1106Claim claim;
1153private unsafe void AddPrimarySidClaim(List<Claim> instanceClaims)
1167Claim claim;
1187private unsafe void AddDeviceGroupSidClaims(List<Claim> instanceClaims, TokenInformationClass tokenInformationClass)
1218Claim claim = new Claim(claimType, groupSid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this);
1226Claim claim = new Claim(claimType, groupSid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this);
1239private unsafe void AddTokenClaims(List<Claim> instanceClaims, TokenInformationClass tokenInformationClass, string propertyValue)
1270Claim c = new Claim(name, Marshal.PtrToStringUni(stringPointers[item])!, ClaimValueTypes.String, _issuerName, _issuerName, this);
1282Claim c = new Claim(name, intValues[item].ToString(CultureInfo.InvariantCulture), ClaimValueTypes.Integer64, _issuerName, _issuerName, this);
1295Claim c = new Claim(name, ((ulong)uintValues[item]).ToString(CultureInfo.InvariantCulture), ClaimValueTypes.UInteger64, _issuerName, _issuerName, this);
1307Claim c = new Claim(