253 references to Claim
Aspire.Dashboard (5)
BasicTestApp (2)
BasicWebSite (3)
ClaimsTransformation (3)
CookiePolicySample (1)
Cookies (2)
CookieSample (1)
CookieSessionSample (1)
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.Core.Test (1)
Microsoft.AspNetCore.Authentication.Negotiate (2)
Microsoft.AspNetCore.Authentication.Test (51)
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.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 (4)
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 (34)
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)
PathSchemeSelection (2)
SecurityWebSite (5)
SignalR.Client.FunctionalTestApp (1)
StaticFilesAuth (2)