58 instantiations of Claim
Aspire.Dashboard (11)
Api\ApiAuthenticationHandler.cs (3)
42var id = new ClaimsIdentity([new Claim(ClaimName, bool.TrueString)], AuthenticationScheme); 75var id = new ClaimsIdentity([new Claim(ClaimName, bool.TrueString)], AuthenticationScheme); 83var id = new ClaimsIdentity([new Claim(ClaimName, bool.TrueString)], AuthenticationScheme);
Authentication\OtlpCompositeAuthenticationHandler.cs (1)
36var id = new ClaimsIdentity([new Claim(OtlpAuthorization.OtlpClaimName, bool.TrueString)]);
Authentication\UnsecuredAuthenticationHandler.cs (2)
21[new Claim(ClaimTypes.NameIdentifier, "Local"), new Claim(FrontendAuthorizationDefaults.UnsecuredClaimName, bool.TrueString)],
DashboardWebApplication.cs (3)
770new Claim(ClaimTypes.NameIdentifier, 773new Claim(ClaimTypes.Name, 854claimsIdentity.AddClaim(new Claim(FrontendAuthorizationDefaults.BrowserTokenClaimName, bool.TrueString));
Mcp\McpCompositeAuthenticationHandler.cs (1)
34var id = new ClaimsIdentity([new Claim(McpApiKeyAuthenticationHandler.McpClaimName, bool.TrueString)]);
Model\ValidateTokenMiddleware.cs (1)
94[new Claim(ClaimTypes.NameIdentifier, "Local")],
Aspire.Dashboard.Tests (2)
DashboardOptionsTests.cs (2)
382new Claim("name", "test") 420new Claim("name", "test")
dotnet-user-jwts (6)
Helpers\JwtIssuer.cs (6)
29identity.AddClaim(new Claim(JwtRegisteredClaimNames.Sub, options.Name)); 32identity.AddClaim(new Claim(JwtRegisteredClaimNames.Jti, id)); 36identity.AddClaims(scopesToAdd.Select(s => new Claim("scope", s))); 41identity.AddClaims(rolesToAdd.Select(r => new Claim(ClaimTypes.Role, r))); 46identity.AddClaims(claimsToAdd.Select(kvp => new Claim(kvp.Key, kvp.Value))); 55identity.AddClaims(audiences.Select(aud => new Claim(JwtRegisteredClaimNames.Aud, aud)));
Microsoft.AspNetCore.Authentication (1)
TicketSerializer.cs (1)
248var claim = new Claim(type, value, valueType, issuer, originalIssuer, identity);
Microsoft.AspNetCore.Authentication.Cookies (2)
CookieAuthenticationHandler.cs (2)
267new[] { new Claim(SessionIdClaim, _sessionKey, ClaimValueTypes.String, Options.ClaimsIssuer) }, 351new[] { new Claim(SessionIdClaim, _sessionKey, ClaimValueTypes.String, Options.ClaimsIssuer) },
Microsoft.AspNetCore.Authentication.OAuth (3)
CustomJsonClaimAction.cs (1)
37identity.AddClaim(new Claim(ClaimType, value, ValueType, issuer));
JsonKeyClaimAction.cs (1)
60identity.AddClaim(new Claim(ClaimType, value, ValueType, issuer));
MapAllClaimsAction.cs (1)
36identity.AddClaim(new Claim(pair.Name, claimValue, ClaimValueTypes.String, issuer));
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)
UserClaimsPrincipalFactory.cs (5)
78id.AddClaim(new Claim(Options.ClaimsIdentity.UserIdClaimType, userId)); 79id.AddClaim(new Claim(Options.ClaimsIdentity.UserNameClaimType, userName!)); 85id.AddClaim(new Claim(Options.ClaimsIdentity.EmailClaimType, email)); 90id.AddClaim(new Claim(Options.ClaimsIdentity.SecurityStampClaimType, 144id.AddClaim(new Claim(Options.ClaimsIdentity.RoleClaimType, roleName));
Microsoft.Extensions.Identity.Stores (2)
IdentityRoleClaim.cs (1)
41return new Claim(ClaimType!, ClaimValue!);
IdentityUserClaim.cs (1)
41return new Claim(ClaimType!, ClaimValue!);
System.Security.Claims (5)
System\Security\Claims\Claim.cs (1)
395return new Claim(this, identity);
System\Security\Claims\ClaimsIdentity.cs (2)
186SafeAddClaim(new Claim(_nameClaimType, identity.Name, ClaimValueTypes.String, DefaultIssuer, DefaultIssuer, this)); 846return new Claim(reader, this);
System\Security\Claims\GenericIdentity.cs (1)
86base.AddClaim(new Claim(base.NameClaimType, m_name, ClaimValueTypes.String, ClaimsIdentity.DefaultIssuer, ClaimsIdentity.DefaultIssuer, this));
System\Security\Claims\GenericPrincipal.cs (1)
55roleClaims.Add(new Claim(claimsIdentity.RoleClaimType, role, ClaimValueTypes.String, ClaimsIdentity.DefaultIssuer, ClaimsIdentity.DefaultIssuer, claimsIdentity));
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)
Extensions\ClaimsIdentityExtensions.cs (1)
18var claim = identity.FindFirst(claimType);
Microsoft.AspNetCore.Antiforgery (5)
Internal\DefaultClaimUidExtractor.cs (5)
47var subClaim = identity.FindFirst( 59var nameIdentifierClaim = identity.FindFirst( 71var upnClaim = identity.FindFirst( 85var allClaims = new List<Claim>(); 105var claim = allClaims[i];
Microsoft.AspNetCore.Authentication (7)
TicketSerializer.cs (7)
100foreach (var claim in identity.Claims) 132protected virtual void WriteClaim(BinaryWriter writer, Claim claim) 209var claim = ReadClaim(reader, identity); 232/// Reads a <see cref="Claim"/> and adds it to the specified <paramref name="identity"/>. 236/// <returns>The read <see cref="Claim"/>.</returns> 237protected virtual Claim ReadClaim(BinaryReader reader, ClaimsIdentity identity) 248var claim = new Claim(type, value, valueType, issuer, originalIssuer, identity);
Microsoft.AspNetCore.Authentication.Cookies (1)
CookieAuthenticationHandler.cs (1)
166var claim = ticket.Principal.Claims.FirstOrDefault(c => c.Type.Equals(SessionIdClaim));
Microsoft.AspNetCore.Authentication.OAuth (3)
ClaimAction.cs (2)
26/// Gets the value to use for <see cref="Claim.Value"/>when creating a Claim. 31/// Gets the value to use for <see cref="Claim.ValueType"/> when creating a Claim.
DeleteClaimAction.cs (1)
27foreach (var claim in identity.FindAll(ClaimType).ToList())
Microsoft.AspNetCore.Authorization (2)
ClaimsAuthorizationRequirement.cs (2)
58foreach (var claim in context.User.Claims) 69foreach (var claim in context.User.Claims)
Microsoft.AspNetCore.Components.Authorization (6)
ClaimData.cs (6)
10/// This is a serializable representation of a <see cref="Claim"/> object that only consists of the type and value. 27/// Constructs a new instance of <see cref="ClaimData"/> from a <see cref="Claim"/> copying only the 28/// <see cref="Claim.Type"/> and <see cref="Claim.Value"/> into their corresponding properties. 30/// <param name="claim">The <see cref="Claim"/> to copy from.</param> 31public ClaimData(Claim claim)
Microsoft.AspNetCore.Identity (13)
SignInManager.cs (13)
209IList<Claim> claims = Array.Empty<Claim>(); 210var authenticationMethod = auth.Principal?.FindFirst(ClaimTypes.AuthenticationMethod); 211var amr = auth.Principal?.FindFirst("amr"); 215claims = new List<Claim>(); 251IList<Claim> additionalClaims = Array.Empty<Claim>(); 254additionalClaims = new List<Claim>(); 267public virtual Task SignInWithClaimsAsync(TUser user, bool isPersistent, IEnumerable<Claim> additionalClaims) 277public virtual async Task SignInWithClaimsAsync(TUser user, AuthenticationProperties? authenticationProperties, IEnumerable<Claim> additionalClaims) 282foreach (var claim in additionalClaims) 850var claims = new List<Claim> 1253await SignInWithClaimsAsync(user, isPersistent, new Claim[] { new Claim("amr", "pwd") });
Microsoft.Extensions.Identity.Core (37)
IRoleClaimStore.cs (7)
18/// Gets a list of <see cref="Claim"/>s to be belonging to the specified <paramref name="role"/> 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(TRole role, CancellationToken cancellationToken = default(CancellationToken)); 31/// <param name="claim">The <see cref="Claim"/> to add.</param> 34Task AddClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken)); 40/// <param name="claim">The <see cref="Claim"/> to remove.</param> 43Task RemoveClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken));
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);
PrincipalExtensions.cs (1)
22var claim = principal.FindFirst(claimType);
RoleManager.cs (6)
134/// Gets a flag indicating whether the underlying persistence store supports <see cref="Claim"/>s for roles. 137/// true if the underlying persistence store supports <see cref="Claim"/>s for roles, otherwise false. 323public virtual async Task<IdentityResult> AddClaimAsync(TRole role, Claim claim) 343public virtual async Task<IdentityResult> RemoveClaimAsync(TRole role, Claim claim) 358/// The <see cref="Task"/> that represents the asynchronous operation, containing the list of <see cref="Claim"/>s 361public virtual Task<IList<Claim>> GetClaimsAsync(TRole role)
UserManager.cs (12)
1175public virtual Task<IdentityResult> AddClaimAsync(TUser user, Claim claim) 1189public virtual async Task<IdentityResult> AddClaimsAsync(TUser user, IEnumerable<Claim> claims) 1219public virtual async Task<IdentityResult> ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim) 1244/// <param name="claim">The <see cref="Claim"/> to remove.</param> 1249public virtual Task<IdentityResult> RemoveClaimAsync(TUser user, Claim claim) 1258/// <param name="claims">A collection of <see cref="Claim"/>s to remove.</param> 1263public virtual async Task<IdentityResult> RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims) 1284/// Gets a list of <see cref="Claim"/>s to be belonging to the specified <paramref name="user"/> as an asynchronous operation. 1288/// A <see cref="Task{TResult}"/> that represents the result of the asynchronous query, a list of <see cref="Claim"/>s. 1290public virtual async Task<IList<Claim>> GetClaimsAsync(TUser user) 2294public virtual Task<IList<TUser>> GetUsersForClaimAsync(Claim claim)
Microsoft.Extensions.Identity.Stores (16)
IdentityRoleClaim.cs (3)
38/// <returns>The <see cref="Claim"/> that was produced.</returns> 39public virtual Claim ToClaim() 48public virtual void InitializeFromClaim(Claim? other)
IdentityUserClaim.cs (2)
39public virtual Claim ToClaim() 48public virtual void InitializeFromClaim(Claim claim)
RoleStoreBase.cs (4)
212public abstract Task<IList<Claim>> GetClaimsAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken)); 221public abstract Task AddClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken)); 230public abstract Task RemoveClaimAsync(TRole role, Claim claim, CancellationToken cancellationToken = default(CancellationToken)); 246protected virtual TRoleClaim CreateRoleClaim(TRole role, Claim claim)
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)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
851[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Claims.Claim))]
netstandard (1)
netstandard.cs (1)
1835[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Claims.Claim))]
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\Claims\ClaimsPrincipal.cs (24)
216public virtual IEnumerable<Claim> Claims 222foreach (Claim claim in identity.Claims) 281public virtual IEnumerable<Claim> FindAll(Predicate<Claim> match) 286IEnumerable<Claim> Core(Predicate<Claim> match) 292foreach (Claim claim in identity.FindAll(match)) 306/// <remarks>Each <see cref="ClaimsIdentity"/> is called. <seealso cref="ClaimsIdentity.FindAll(Predicate{Claim})"/>.</remarks> 308public virtual IEnumerable<Claim> FindAll(string type) 313IEnumerable<Claim> Core(string type) 319foreach (Claim claim in identity.FindAll(type)) 329/// Retrieves the first <see cref="Claim"/> that is matched by <paramref name="match"/>. 332/// <returns>A <see cref="Claim"/>, null if nothing matches.</returns> 335public virtual Claim? FindFirst(Predicate<Claim> match) 339Claim? claim = null; 357/// Retrieves the first <see cref="Claim"/> where the Claim.Type equals <paramref name="type"/>. 360/// <returns>A <see cref="Claim"/>, null if nothing matches.</returns> 361/// <remarks>Each <see cref="ClaimsIdentity"/> is called. <seealso cref="ClaimsIdentity.FindFirst(Predicate{Claim})"/>.</remarks> 363public virtual Claim? FindFirst(string type) 367Claim? claim = null; 391public virtual bool HasClaim(Predicate<Claim> match) 415/// <remarks>Each <see cref="ClaimsIdentity"/> is called. <seealso cref="ClaimsIdentity.HasClaim(Predicate{Claim})"/>.</remarks> 577foreach (Claim item in Claims)
System\Security\Claims\GenericIdentity.cs (1)
50public override IEnumerable<Claim> Claims
System\Security\Claims\GenericPrincipal.cs (2)
49List<Claim> roleClaims = new List<Claim>(roles.Length);
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(
System\Security\Principal\WindowsPrincipal.cs (4)
76public virtual IEnumerable<Claim> UserClaims 84foreach (Claim claim in wi.UserClaims) 97public virtual IEnumerable<Claim> DeviceClaims 105foreach (Claim claim in wi.DeviceClaims)