314 instantiations of Claim
Aspire.Dashboard (7)
BasicTestApp (2)
BasicWebSite (3)
Certificate.Sample (2)
ClaimsTransformation (3)
CookiePolicySample (1)
Cookies (2)
CookieSample (1)
CookieSessionSample (2)
CustomPolicyProvider (2)
dotnet-user-jwts (6)
HtmlGenerationWebSite (1)
Identity.DefaultUI.WebSite (2)
JwtSample (1)
Microsoft.AspNetCore.Antiforgery.Test (25)
DefaultClaimUidExtractorTest.cs (24)
39mockIdentity.Setup(o => o.Claims).Returns(new Claim[] { new Claim(ClaimTypes.Name, "someName") });
55identity.AddClaim(new Claim(ClaimTypes.Email, "someone@antiforgery.com"));
56identity.AddClaim(new Claim(ClaimTypes.GivenName, "some"));
57identity.AddClaim(new Claim(ClaimTypes.Surname, "one"));
58identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, string.Empty));
84identity.AddClaim(new Claim("fooClaim", "fooClaimValue"));
85identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, "nameIdentifierValue"));
104identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, "nameIdentifierValue"));
105identity.AddClaim(new Claim("sub", "subClaimValue"));
106identity.AddClaim(new Claim(ClaimTypes.Upn, "upnClaimValue"));
125identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, "nameIdentifierValue"));
126identity.AddClaim(new Claim(ClaimTypes.Upn, "upnClaimValue"));
145identity.AddClaim(new Claim("fooClaim", "fooClaimValue"));
146identity.AddClaim(new Claim(ClaimTypes.Upn, "upnClaimValue"));
165identity1.AddClaim(new Claim("sub", "subClaimValue"));
167identity2.AddClaim(new Claim(ClaimTypes.NameIdentifier, "nameIdentifierValue"));
186identity1.AddClaim(new Claim("sub", "subClaimValue"));
188identity2.AddClaim(new Claim(ClaimTypes.Email, "email@domain.com"));
190identity3.AddClaim(new Claim(ClaimTypes.Country, "countryValue"));
192identity4.AddClaim(new Claim(ClaimTypes.Name, "claimName"));
218identity1.AddClaim(new Claim(ClaimTypes.NameIdentifier, "nameIdentifierValue"));
220identity2.AddClaim(new Claim("sub", "subClaimValue"));
240identity1.AddClaim(new Claim(ClaimTypes.Upn, "upnValue"));
242identity2.AddClaim(new Claim(ClaimTypes.NameIdentifier, "nameIdentifierValue"));
Microsoft.AspNetCore.Authentication (1)
Microsoft.AspNetCore.Authentication.Certificate (9)
CertificateAuthenticationHandler.cs (9)
242claims.Add(new Claim("issuer", issuer, ClaimValueTypes.String, Options.ClaimsIssuer));
245claims.Add(new Claim(ClaimTypes.Thumbprint, thumbprint, ClaimValueTypes.Base64Binary, Options.ClaimsIssuer));
250claims.Add(new Claim(ClaimTypes.X500DistinguishedName, value, ClaimValueTypes.String, Options.ClaimsIssuer));
256claims.Add(new Claim(ClaimTypes.SerialNumber, value, ClaimValueTypes.String, Options.ClaimsIssuer));
262claims.Add(new Claim(ClaimTypes.Dns, value, ClaimValueTypes.String, Options.ClaimsIssuer));
268claims.Add(new Claim(ClaimTypes.Name, value, ClaimValueTypes.String, Options.ClaimsIssuer));
274claims.Add(new Claim(ClaimTypes.Email, value, ClaimValueTypes.String, Options.ClaimsIssuer));
280claims.Add(new Claim(ClaimTypes.Upn, value, ClaimValueTypes.String, Options.ClaimsIssuer));
286claims.Add(new Claim(ClaimTypes.Uri, value, ClaimValueTypes.String, Options.ClaimsIssuer));
Microsoft.AspNetCore.Authentication.Cookies (2)
Microsoft.AspNetCore.Authentication.Core.Test (1)
Microsoft.AspNetCore.Authentication.Negotiate (2)
Microsoft.AspNetCore.Authentication.OAuth (3)
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
Microsoft.AspNetCore.Authentication.Test (69)
CertificateTests.cs (7)
583new Claim(ClaimTypes.Name, Expected, ClaimValueTypes.String, context.Options.ClaimsIssuer),
584new Claim("ValidationCount", validationCount.ToString(CultureInfo.InvariantCulture), ClaimValueTypes.String, context.Options.ClaimsIssuer)
654new Claim(ClaimTypes.Name, Expected, ClaimValueTypes.String, context.Options.ClaimsIssuer)
710new Claim(ClaimTypes.Name, Expected, ClaimValueTypes.String, context.Options.ClaimsIssuer),
711new Claim("ValidationCount", validationCount.ToString(CultureInfo.InvariantCulture), ClaimValueTypes.String, context.Options.ClaimsIssuer)
912new Claim(ClaimTypes.NameIdentifier, context.ClientCertificate.Subject, ClaimValueTypes.String, context.Options.ClaimsIssuer),
913new Claim(ClaimTypes.Name, context.ClientCertificate.Subject, ClaimValueTypes.String, context.Options.ClaimsIssuer)
JwtBearerTests.cs (12)
55new Claim(ClaimTypes.NameIdentifier, "Bob")
92new Claim(ClaimTypes.NameIdentifier, "Bob")
230new Claim(ClaimTypes.NameIdentifier, "Bob le Magnifique"),
231new Claim(ClaimTypes.Email, "bob@contoso.com"),
232new Claim(ClaimsIdentity.DefaultNameClaimType, "bob")
503identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, "Bob le Magnifique"));
924new Claim(ClaimTypes.NameIdentifier, "Bob")
969new Claim(ClaimTypes.NameIdentifier, "Bob")
1150new Claim(ClaimTypes.NameIdentifier, "Bob le Tout Puissant"),
1151new Claim(ClaimTypes.Email, "bob@contoso.com"),
1152new Claim(ClaimsIdentity.DefaultNameClaimType, "bob"),
1281new Claim(ClaimTypes.NameIdentifier, "Bob")
JwtBearerTests_Handler.cs (12)
47new Claim(ClaimTypes.NameIdentifier, "Bob")
83new Claim(ClaimTypes.NameIdentifier, "Bob")
217new Claim(ClaimTypes.NameIdentifier, "Bob le Magnifique"),
218new Claim(ClaimTypes.Email, "bob@contoso.com"),
219new Claim(ClaimsIdentity.DefaultNameClaimType, "bob")
472identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, "Bob le Magnifique"));
869new Claim(ClaimTypes.NameIdentifier, "Bob")
913new Claim(ClaimTypes.NameIdentifier, "Bob")
1212new Claim(ClaimTypes.NameIdentifier, "Bob le Tout Puissant"),
1213new Claim(ClaimTypes.Email, "bob@contoso.com"),
1214new Claim(ClaimsIdentity.DefaultNameClaimType, "bob"),
1348new Claim(ClaimTypes.NameIdentifier, "Bob")
Microsoft.AspNetCore.Authentication.Twitter (4)
Microsoft.AspNetCore.Authorization.Test (36)
AuthorizationMiddlewareTests.cs (7)
1015new Claim("Permission", "CanViewPage"),
1016new Claim(ClaimTypes.Role, "Administrator"),
1017new Claim(ClaimTypes.Role, "User"),
1018new Claim(ClaimTypes.NameIdentifier, "John")},
1025new Claim("Permission", "CupBearer"),
1026new Claim(ClaimTypes.Role, "Token"),
1027new Claim(ClaimTypes.NameIdentifier, "John Bear")},
DefaultAuthorizationServiceTests.cs (28)
41var user = new ClaimsPrincipal(new ClaimsIdentity(new Claim[] { new Claim("Permission", "CanViewPage") }));
62var user = new ClaimsPrincipal(new ClaimsIdentity(new Claim[] { new Claim("Permission", "CanViewPage") }, "Basic"));
80new Claim("Permission", "CanViewPage"),
81new Claim("Permission", "CanViewAnything")
208new Claim("SomethingElse", "CanViewPage"),
230new Claim("SomethingElse", "CanViewPage"),
251new Claim("Permission", "CanViewComment"),
320new Claim("Permission", "CanViewPage"),
354new Claim(ClaimTypes.Role, "User"),
355new Claim(ClaimTypes.Role, "Administrator")
376new Claim(ClaimTypes.Role, "none"),
395new ClaimsIdentity(new Claim[] { new Claim(ClaimTypes.Name, "Name") }, "AuthType")
412new ClaimsIdentity(new Claim[] { new Claim(ClaimTypes.Role, "Admin") }, "AuthType")
429new ClaimsIdentity(new Claim[] { new Claim(ClaimTypes.Role, "Users") }, "AuthType"));
447new Claim(ClaimTypes.Role, "Nope"),
495new Claim(ClaimTypes.Name, "Tek"),
521new Claim(ClaimTypes.Name, "Hao"),
545identity.AddClaim(new Claim("Name", "Hao"));
567identity.AddClaim(new Claim("Role", "Hao"));
591new Claim(ClaimTypes.Name, "Name"),
732new Claim("Base", "Value"),
733new Claim("Claim", "Exists")
760new Claim("Claim", "Exists")
787new Claim("Base", "Value"),
851new Claim("SuperUser", "yes"),
915new Claim("SuperUser", "yes")
1062id.AddClaim(new Claim("1", "1"));
1063id.AddClaim(new Claim("2", "2"));
Microsoft.AspNetCore.Components.Server.Tests (1)
Microsoft.AspNetCore.Http.Connections.Tests (4)
Microsoft.AspNetCore.Identity (7)
Microsoft.AspNetCore.Identity.EntityFrameworkCore (1)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (14)
UserStoreWithGenericsTest.cs (10)
102Claim[] claims = { new Claim("c1", "v1", null, "i1"), new Claim("c2", "v2", null, "i2"), new Claim("c2", "v3", null, "i3") };
132Claim[] claims = { new Claim("c", "v", null, "i1"), new Claim("c2", "v2", null, "i2"), new Claim("c2", "v3", null, "i3") };
159IdentityResultAssert.IsSuccess(await manager.AddClaimAsync(user, new Claim("c", "a", "i")));
162Claim claim = new Claim("c", "b", "i");
268return new Claim(ClaimType, ClaimValue, null, Issuer);
285return new Claim(ClaimType, ClaimValue, null, Issuer);
Microsoft.AspNetCore.Identity.InMemory.Test (4)
Microsoft.AspNetCore.Identity.Specification.Tests (17)
UserManagerSpecificationTests.cs (14)
709Claim[] claims = { new Claim("c", "v"), new Claim("c2", "v2"), new Claim("c2", "v3") };
740Claim[] claims = { new Claim("c", "v"), new Claim("c2", "v2"), new Claim("c2", "v3") };
771IdentityResultAssert.IsSuccess(await manager.AddClaimAsync(user, new Claim("c", "a")));
774Claim claim = new Claim("c", "b");
796IdentityResultAssert.IsSuccess(await manager.AddClaimAsync(user, new Claim("c", "a")));
797IdentityResultAssert.IsSuccess(await manager.AddClaimAsync(user2, new Claim("c", "a")));
802Claim claim = new Claim("c", "b");
1927IdentityResultAssert.IsSuccess(await manager.AddClaimAsync(user, new Claim("foo", "bar")));
1931Assert.Equal(3, (await manager.GetUsersForClaimAsync(new Claim("foo", "bar"))).Count);
1933Assert.Empty((await manager.GetUsersForClaimAsync(new Claim("123", "456"))));
Microsoft.AspNetCore.Identity.Test (35)
UserManagerTest.cs (14)
506var claims = new Claim[] { new Claim("1", "1"), new Claim("2", "2"), new Claim("3", "3") };
527var claim = new Claim("1", "1");
548var claim = new Claim("1", "1");
549var newClaim = new Claim("1", "2");
635var claims = new Claim[] { new Claim("1", "1"), new Claim("2", "2"), new Claim("3", "3") };
656var claim = new Claim("1", "1");
1055async () => await manager.AddClaimAsync(null, new Claim("a", "b")));
1075async () => await manager.RemoveClaimAsync(null, new Claim("a", "b")));
1085async () => await manager.ReplaceClaimAsync(null, new Claim("a", "b"), new Claim("a", "c")));
Microsoft.AspNetCore.Mvc.Core.Test (7)
Authorization\AuthorizeFilterTest.cs (7)
578new Claim("Permission", "CanViewPage"),
579new Claim(ClaimTypes.Role, "Administrator"),
580new Claim(ClaimTypes.Role, "User"),
581new Claim(ClaimTypes.NameIdentifier, "John")},
588new Claim("Permission", "CupBearer"),
589new Claim(ClaimTypes.Role, "Token"),
590new Claim(ClaimTypes.NameIdentifier, "John Bear")},
Microsoft.AspNetCore.Mvc.TagHelpers.Test (2)
Microsoft.AspNetCore.Shared.Tests (1)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (1)
Microsoft.AspNetCore.SignalR.Specification.Tests (2)
Microsoft.AspNetCore.SignalR.Tests (3)
Microsoft.AspNetCore.SignalR.Tests.Utils (2)
Microsoft.AspNetCore.Tests (1)
Microsoft.Extensions.Identity.Core (5)
Microsoft.Extensions.Identity.Stores (2)
OpenIdConnectSample (1)
PathSchemeSelection (3)
SecurityWebSite (5)
SignalR.Client.FunctionalTestApp (1)
StaticFilesAuth (2)
System.Security.Claims (5)
413 references to Claim
Aspire.Dashboard (1)
ClaimsTransformation (2)
Cookies (1)
CookieSessionSample (1)
CustomPolicyProvider (2)
Identity.DefaultUI.WebSite (10)
Microsoft.AspNetCore.Antiforgery (5)
Microsoft.AspNetCore.Antiforgery.Test (3)
Microsoft.AspNetCore.Authentication (7)
Microsoft.AspNetCore.Authentication.Certificate (1)
Microsoft.AspNetCore.Authentication.Cookies (1)
Microsoft.AspNetCore.Authentication.OAuth (3)
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
Microsoft.AspNetCore.Authentication.Test (12)
Microsoft.AspNetCore.Authorization (2)
Microsoft.AspNetCore.Authorization.Test (26)
DefaultAuthorizationServiceTests.cs (24)
41var user = new ClaimsPrincipal(new ClaimsIdentity(new Claim[] { new Claim("Permission", "CanViewPage") }));
62var user = new ClaimsPrincipal(new ClaimsIdentity(new Claim[] { new Claim("Permission", "CanViewPage") }, "Basic"));
79new Claim[] {
207new Claim[] {
229new Claim[] {
250new Claim[] {
271new Claim[0],
319new Claim[] {
353new Claim[] {
375new Claim[] {
395new ClaimsIdentity(new Claim[] { new Claim(ClaimTypes.Name, "Name") }, "AuthType")
412new ClaimsIdentity(new Claim[] { new Claim(ClaimTypes.Role, "Admin") }, "AuthType")
429new ClaimsIdentity(new Claim[] { new Claim(ClaimTypes.Role, "Users") }, "AuthType"));
446new Claim[] {
467new Claim[] {
494new Claim[] {
520new Claim[] {
590new Claim[] {
731new Claim[] {
759new Claim[] {
786new Claim[] {
850new Claim[] {
893new Claim[] {
914new Claim[] {
Microsoft.AspNetCore.Components.Authorization (6)
Microsoft.AspNetCore.Components.WebAssembly.Server (2)
Microsoft.AspNetCore.Http.Connections.Tests (1)
Microsoft.AspNetCore.Identity (13)
Microsoft.AspNetCore.Identity.EntityFrameworkCore (20)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (22)
UserStoreWithGenericsTest.cs (18)
102Claim[] claims = { new Claim("c1", "v1", null, "i1"), new Claim("c2", "v2", null, "i2"), new Claim("c2", "v3", null, "i3") };
103foreach (Claim c in claims)
132Claim[] claims = { new Claim("c", "v", null, "i1"), new Claim("c2", "v2", null, "i2"), new Claim("c2", "v3", null, "i3") };
133foreach (Claim c in claims)
162Claim claim = new Claim("c", "b", "i");
163Claim oldClaim = userClaims.FirstOrDefault();
167Claim newClaim = newUserClaims.FirstOrDefault();
174public class ClaimEqualityComparer : IEqualityComparer<Claim>
176public static IEqualityComparer<Claim> Default = new ClaimEqualityComparer();
178public bool Equals(Claim x, Claim y)
183public int GetHashCode(Claim obj)
218protected override IdentityUserClaimWithIssuer CreateUserClaim(IdentityUserWithGenerics user, Claim claim)
256protected override IdentityRoleClaimWithIssuer CreateRoleClaim(MyIdentityRole role, Claim claim)
266public override Claim ToClaim()
271public override void InitializeFromClaim(Claim other)
283public override Claim ToClaim()
288public override void InitializeFromClaim(Claim other)
Microsoft.AspNetCore.Identity.InMemory.Test (13)
Microsoft.AspNetCore.Identity.Specification.Tests (13)
UserManagerSpecificationTests.cs (11)
709Claim[] claims = { new Claim("c", "v"), new Claim("c2", "v2"), new Claim("c2", "v3") };
710foreach (Claim c in claims)
740Claim[] claims = { new Claim("c", "v"), new Claim("c2", "v2"), new Claim("c2", "v3") };
741foreach (Claim c in claims)
774Claim claim = new Claim("c", "b");
775Claim oldClaim = userClaims.Count == 0 ? null : userClaims[0];
779Claim newClaim = newUserClaims.Count == 0 ? null : newUserClaims[0];
802Claim claim = new Claim("c", "b");
803Claim oldClaim = userClaims.Count == 0 ? null : userClaims[0];
807Claim newClaim = newUserClaims.Count == 0 ? null : newUserClaims[0];
812Claim oldClaim2 = userClaims2.Count == 0 ? null : userClaims2[0];
Microsoft.AspNetCore.Identity.Test (28)
UserManagerTest.cs (24)
506var claims = new Claim[] { new Claim("1", "1"), new Claim("2", "2"), new Claim("3", "3") };
527var claim = new Claim("1", "1");
528store.Setup(s => s.AddClaimsAsync(user, It.IsAny<IEnumerable<Claim>>(), CancellationToken.None))
548var claim = new Claim("1", "1");
549var newClaim = new Claim("1", "2");
550store.Setup(s => s.ReplaceClaimAsync(user, It.IsAny<Claim>(), It.IsAny<Claim>(), CancellationToken.None))
635var claims = new Claim[] { new Claim("1", "1"), new Claim("2", "2"), new Claim("3", "3") };
656var claim = new Claim("1", "1");
657store.Setup(s => s.RemoveClaimsAsync(user, It.IsAny<IEnumerable<Claim>>(), CancellationToken.None))
1218public Task<IList<Claim>> GetClaimsAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1220return Task.FromResult<IList<Claim>>(new List<Claim>());
1223public Task AddClaimsAsync(PocoUser user, IEnumerable<Claim> claim, CancellationToken cancellationToken = default(CancellationToken))
1228public Task ReplaceClaimAsync(PocoUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken))
1233public Task RemoveClaimsAsync(PocoUser user, IEnumerable<Claim> claim, CancellationToken cancellationToken = default(CancellationToken))
1447public Task<IList<PocoUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken))
1498public Task<IList<Claim>> GetClaimsAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1503public Task AddClaimsAsync(PocoUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken))
1508public Task ReplaceClaimAsync(PocoUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = default(CancellationToken))
1513public Task RemoveClaimsAsync(PocoUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = default(CancellationToken))
1703public Task<IList<PocoUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = default(CancellationToken))
Microsoft.AspNetCore.Mvc.Core.Test (2)
Microsoft.AspNetCore.SignalR.Specification.Tests (1)
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
Microsoft.Extensions.Identity.Core (39)
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)
OpenIdConnectSample (1)
PathSchemeSelection (1)
SecurityWebSite (1)
SocialSample (1)
StaticFilesAuth (1)
System.Security.Claims (146)
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 (75)
36private List<List<Claim>>? _externalClaims;
38private readonly List<Claim> _instanceClaims = new List<Claim>();
55: this((IIdentity?)null, (IEnumerable<Claim>?)null, (string?)null, (string?)null, (string?)null)
63/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
65: this(identity, (IEnumerable<Claim>?)null, (string?)null, (string?)null, (string?)null)
74/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
76public ClaimsIdentity(IEnumerable<Claim>? claims)
86: this((IIdentity?)null, (IEnumerable<Claim>?)null, authenticationType, (string?)null, (string?)null)
95/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
96public ClaimsIdentity(IEnumerable<Claim>? claims, string? authenticationType)
106/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
107public ClaimsIdentity(IIdentity? identity, IEnumerable<Claim>? claims)
116/// <param name="nameType">The <see cref="Claim.Type"/> used when obtaining the value of <see cref="ClaimsIdentity.Name"/>.</param>
117/// <param name="roleType">The <see cref="Claim.Type"/> used when performing logic for <see cref="ClaimsPrincipal.IsInRole"/>.</param>
118/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
120: this((IIdentity?)null, (IEnumerable<Claim>?)null, authenticationType, nameType, roleType)
129/// <param name="nameType">The <see cref="Claim.Type"/> used when obtaining the value of <see cref="ClaimsIdentity.Name"/>.</param>
130/// <param name="roleType">The <see cref="Claim.Type"/> used when performing logic for <see cref="ClaimsPrincipal.IsInRole"/>.</param>
131/// <remarks><seealso cref="ClaimsIdentity(IIdentity, IEnumerable{Claim}, string, string, string)"/> for details on how internal values are set.</remarks>
132public ClaimsIdentity(IEnumerable<Claim>? claims, string? authenticationType, string? nameType, string? roleType)
143/// <param name="nameType">The <see cref="Claim.Type"/> used when obtaining the value of <see cref="ClaimsIdentity.Name"/>.</param>
144/// <param name="roleType">The <see cref="Claim.Type"/> used when performing logic for <see cref="ClaimsPrincipal.IsInRole"/>.</param>
147/// <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>
151public ClaimsIdentity(IIdentity? identity, IEnumerable<Claim>? claims, string? authenticationType, string? nameType, string? roleType)
306public virtual IEnumerable<Claim> Claims
319private IEnumerable<Claim> CombinedClaimsIterator()
330foreach (Claim claim in _externalClaims[j])
353internal List<List<Claim>> ExternalClaims => _externalClaims ??= new List<List<Claim>>();
367/// <remarks>Calls <see cref="FindFirst(string)"/> where string == NameClaimType, if found, returns <see cref="Claim.Value"/> otherwise null.</remarks>
373Claim? claim = FindFirst(_nameClaimType);
408/// Adds a single <see cref="Claim"/> to an internal list.
410/// <param name="claim">the <see cref="Claim"/>add.</param>
411/// <remarks>If <see cref="Claim.Subject"/> != this, then Claim.Clone(this) is called before the claim is added.</remarks>
413public virtual void AddClaim(Claim claim)
431/// <remarks>Each claim is examined and if <see cref="Claim.Subject"/> != this, then Claim.Clone(this) is called before the claim is added.</remarks>
433public virtual void AddClaims(IEnumerable<Claim?> claims)
437foreach (Claim? claim in claims)
456/// Attempts to remove a <see cref="Claim"/> the internal list.
458/// <param name="claim">the <see cref="Claim"/> to match.</param>
459/// <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.
462public virtual bool TryRemoveClaim(Claim? claim)
484/// Removes a <see cref="Claim"/> from the internal list.
486/// <param name="claim">the <see cref="Claim"/> to match.</param>
487/// <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.
491public virtual void RemoveClaim(Claim? claim)
504private void SafeAddClaims(IEnumerable<Claim?> claims)
506foreach (Claim? claim in claims)
526private void SafeAddClaim(Claim? claim)
547public virtual IEnumerable<Claim> FindAll(Predicate<Claim> match)
552IEnumerable<Claim> Core(Predicate<Claim> match)
554foreach (Claim claim in Claims)
571public virtual IEnumerable<Claim> FindAll(string type)
576IEnumerable<Claim> Core(string type)
578foreach (Claim claim in Claims)
592/// Retrieves the first <see cref="Claim"/> that is matched by <paramref name="match"/>.
595/// <returns>A <see cref="Claim"/>, null if nothing matches.</returns>
597public virtual Claim? FindFirst(Predicate<Claim> match)
601foreach (Claim claim in Claims)
613/// Retrieves the first <see cref="Claim"/> where Claim.Type equals <paramref name="type"/>.
616/// <returns>A <see cref="Claim"/>, null if nothing matches.</returns>
619public virtual Claim? FindFirst(string type)
623foreach (Claim claim in Claims)
643public virtual bool HasClaim(Predicate<Claim> match)
647foreach (Claim claim in Claims)
672foreach (Claim claim in Claims)
767/// Provides an extensibility point for derived types to create a custom <see cref="Claim"/>.
770/// <returns>a new <see cref="Claim"/>.</returns>
771protected virtual Claim CreateClaim(BinaryReader reader)
881foreach (var claim in _instanceClaims)
943foreach (Claim item in Claims)
System.Security.Principal.Windows (5)