111 references to Type
CustomPolicyProvider (1)
Authorization\MinimumAgeAuthorizationHandler.cs (1)
32var dateOfBirthClaim = context.User.FindFirst(c => c.Type == ClaimTypes.DateOfBirth);
Identity.DefaultUI.WebSite (5)
src\Identity\test\InMemory.Test\InMemoryUserStore.cs (5)
43user.Claims.Add(new PocoUserClaim { ClaimType = claim.Type, ClaimValue = claim.Value, UserId = user.Id }); 50var matchedClaims = user.Claims.Where(uc => uc.ClaimValue == claim.Value && uc.ClaimType == claim.Type).ToList(); 54matchedClaim.ClaimType = newClaim.Type; 65uc => uc.UserId == user.Id && uc.ClaimType == claim.Type && uc.ClaimValue == claim.Value); 339where user.Claims.Where(x => x.ClaimType == claim.Type && x.ClaimValue == claim.Value).FirstOrDefault() != null
Identity.ExternalClaims (1)
Pages\Account\ExternalLogin.cshtml.cs (1)
98if (info.Principal.HasClaim(c => c.Type == ClaimTypes.Email))
Microsoft.AspNetCore.Antiforgery (9)
Internal\DefaultClaimUidExtractor.cs (9)
56claim => string.Equals("sub", claim.Type, StringComparison.Ordinal)); 61subClaim.Type, 68claim => string.Equals(ClaimTypes.NameIdentifier, claim.Type, StringComparison.Ordinal)); 73nameIdentifierClaim.Type, 80claim => string.Equals(ClaimTypes.Upn, claim.Type, StringComparison.Ordinal)); 85upnClaim.Type, 108allClaims.Sort((a, b) => string.Compare(a.Type, b.Type, StringComparison.Ordinal)); 114identifierParameters.Add(claim.Type);
Microsoft.AspNetCore.Antiforgery.Test (3)
DefaultClaimUidExtractorTest.cs (3)
67claims.Sort((a, b) => string.Compare(a.Type, b.Type, StringComparison.Ordinal)); 73Assert.Equal(identiferParameters[index++], claim.Type);
Microsoft.AspNetCore.Authentication (1)
TicketSerializer.cs (1)
125WriteWithDefault(writer, claim.Type, claim.Subject?.NameClaimType ?? ClaimsIdentity.DefaultNameClaimType);
Microsoft.AspNetCore.Authentication.Cookies (1)
CookieAuthenticationHandler.cs (1)
166var claim = ticket.Principal.Claims.FirstOrDefault(c => c.Type.Equals(SessionIdClaim));
Microsoft.AspNetCore.Authentication.Negotiate.Test (1)
NegotiateHandlerTests.cs (1)
448claim => claim.Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/role"
Microsoft.AspNetCore.Authentication.OAuth (1)
MapAllClaimsAction.cs (1)
31var duplicate = identity.FindFirst(c => string.Equals(c.Type, pair.Name, StringComparison.OrdinalIgnoreCase)
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
UniqueJsonKeyClaimAction.cs (1)
39var claim = identity.FindFirst(c => string.Equals(c.Type, ClaimType, StringComparison.OrdinalIgnoreCase));
Microsoft.AspNetCore.Authentication.Test (14)
CertificateTests.cs (1)
833await response.WriteAsync($"<claim Type=\"{claim.Type}\" Issuer=\"{claim.Issuer}\">{claim.Value}</claim>");
ClaimActionTests.cs (8)
22Assert.Equal("name", identity.FindFirst("name").Type); 38Assert.Equal("role", roleClaims[0].Type); 40Assert.Equal("role", roleClaims[1].Type); 54Assert.Equal("name", identity.FindFirst("name").Type); 70Assert.Equal("role", roleClaims[0].Type); 72Assert.Equal("role", roleClaims[1].Type); 85Assert.Equal("name0", identity.FindFirst("name0").Type); 87Assert.Equal("name1", identity.FindFirst("name1").Type);
CookieTests.cs (1)
1893xml.Add(result.Ticket.Principal.Claims.Select(claim => new XElement("claim", new XAttribute("type", claim.Type), new XAttribute("value", claim.Value))));
OpenIdConnect\UniqueJsonKeyClaimActionTests.cs (2)
24Assert.Equal("claimType", claim.Type); 41Assert.Equal("claimType", claims.First().Type);
TestExtensions.cs (1)
55new XElement("claim", new XAttribute("type", claim.Type),
TicketSerializerTests.cs (1)
111Assert.Equal("type", claim.Type);
Microsoft.AspNetCore.Authorization (2)
ClaimsAuthorizationRequirement.cs (2)
60if (string.Equals(claim.Type, requirement.ClaimType, StringComparison.OrdinalIgnoreCase)) 71if (string.Equals(claim.Type, requirement.ClaimType, StringComparison.OrdinalIgnoreCase)
Microsoft.AspNetCore.Components.WebAssembly.Server (3)
AuthenticationStateSerializationOptions.cs (3)
54data.Claims.Add(new(claim.Type, claim.Value)); 61data.Claims.Add(new(nameClaim.Type, nameClaim.Value)); 66data.Claims.Add(new(roleClaim.Type, roleClaim.Value));
Microsoft.AspNetCore.Identity.EntityFrameworkCore (10)
RoleStore.cs (2)
373var claims = await RoleClaims.Where(rc => rc.RoleId.Equals(role.Id) && rc.ClaimValue == claim.Value && rc.ClaimType == claim.Type).ToListAsync(cancellationToken); 394=> new TRoleClaim { RoleId = role.Id, ClaimType = claim.Type, ClaimValue = claim.Value };
UserOnlyStore.cs (4)
333var matchedClaims = await UserClaims.Where(uc => uc.UserId.Equals(user.Id) && uc.ClaimValue == claim.Value && uc.ClaimType == claim.Type).ToListAsync(cancellationToken); 337matchedClaim.ClaimType = newClaim.Type; 355var matchedClaims = await UserClaims.Where(uc => uc.UserId.Equals(user.Id) && uc.ClaimValue == claim.Value && uc.ClaimType == claim.Type).ToListAsync(cancellationToken); 475&& userclaims.ClaimType == claim.Type
UserStore.cs (4)
448var matchedClaims = await UserClaims.Where(uc => uc.UserId.Equals(user.Id) && uc.ClaimValue == claim.Value && uc.ClaimType == claim.Type).ToListAsync(cancellationToken); 452matchedClaim.ClaimType = newClaim.Type; 470var matchedClaims = await UserClaims.Where(uc => uc.UserId.Equals(user.Id) && uc.ClaimValue == claim.Value && uc.ClaimType == claim.Type).ToListAsync(cancellationToken); 590&& userclaims.ClaimType == claim.Type
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (8)
UserStoreWithGenericsTest.cs (8)
168Assert.Equal(claim.Type, newClaim.Type); 180return x.Value == y.Value && x.Type == y.Type && x.Issuer == y.Issuer; 220return new IdentityUserClaimWithIssuer { UserId = user.Id, ClaimType = claim.Type, ClaimValue = claim.Value, Issuer = claim.Issuer }; 258return new IdentityRoleClaimWithIssuer { RoleId = role.Id, ClaimType = claim.Type, ClaimValue = claim.Value, Issuer = claim.Issuer }; 274ClaimType = other.Type; 291ClaimType = other.Type;
Microsoft.AspNetCore.Identity.FunctionalTests (6)
ManagementTests.cs (5)
172Assert.NotNull(principals[1].Identities.Single().Claims.Single(c => c.Type == ClaimTypes.AuthenticationMethod).Value); 367var expectedPrincipalClaim = expectedPrincipal.Identities.Single().Claims.Single(c => c.Type == claimType).Value; 368var actualPrincipalClaim = actualPrincipal.Identities.Single().Claims.Single(c => c.Type == claimType).Value; 374var expectedPrincipalClaim = expectedPrincipal.Identities.Single().Claims.Single(c => c.Type == claimType).Value; 375var actualPrincipalClaim = actualPrincipal.Identities.Single().Claims.Single(c => c.Type == claimType).Value;
MapIdentityApiTests.cs (1)
1307authGroup.MapGet("/claims", (ClaimsPrincipal user) => user.Claims.Select(c => new { c.Type, c.Value }));
Microsoft.AspNetCore.Identity.InMemory.Test (8)
FunctionalTest.cs (1)
412xml.Add(result.Principal.Claims.Select(claim => new XElement("claim", new XAttribute("type", claim.Type), new XAttribute("value", claim.Value))));
InMemoryStore.cs (2)
134role.Claims.Add(new PocoRoleClaim<string> { ClaimType = claim.Type, ClaimValue = claim.Value, RoleId = role.Id }); 142ur => ur.RoleId == role.Id && ur.ClaimType == claim.Type && ur.ClaimValue == claim.Value);
InMemoryUserStore.cs (5)
43user.Claims.Add(new PocoUserClaim { ClaimType = claim.Type, ClaimValue = claim.Value, UserId = user.Id }); 50var matchedClaims = user.Claims.Where(uc => uc.ClaimValue == claim.Value && uc.ClaimType == claim.Type).ToList(); 54matchedClaim.ClaimType = newClaim.Type; 65uc => uc.UserId == user.Id && uc.ClaimType == claim.Type && uc.ClaimValue == claim.Value); 339where user.Claims.Where(x => x.ClaimType == claim.Type && x.ClaimValue == claim.Value).FirstOrDefault() != null
Microsoft.AspNetCore.Identity.Specification.Tests (5)
UserManagerSpecificationTests.cs (5)
780Assert.Equal(claim.Type, newClaim.Type); 808Assert.Equal(claim.Type, newClaim.Type); 813Assert.Equal("c", oldClaim2.Type);
Microsoft.AspNetCore.Identity.Test (11)
UserClaimsPrincipalFactoryTest.cs (11)
97claims, c => c.Type == manager.Options.ClaimsIdentity.UserNameClaimType && c.Value == user.UserName); 98Assert.Contains(claims, c => c.Type == manager.Options.ClaimsIdentity.UserIdClaimType && c.Value == user.Id); 99Assert.Equal(supportsUserEmail, claims.Any(c => c.Type == manager.Options.ClaimsIdentity.EmailClaimType && c.Value == user.Email)); 100Assert.Equal(supportRoles, claims.Any(c => c.Type == manager.Options.ClaimsIdentity.RoleClaimType && c.Value == "Admin")); 101Assert.Equal(supportRoles, claims.Any(c => c.Type == manager.Options.ClaimsIdentity.RoleClaimType && c.Value == "Local")); 104Assert.Equal(supportClaims, claims.Any(c => c.Type == cl.Type && c.Value == cl.Value)); 108Assert.Equal(supportRoleClaims, claims.Any(c => c.Type == cl.Type && c.Value == cl.Value)); 112Assert.Equal(supportRoleClaims, claims.Any(c => c.Type == cl.Type && c.Value == cl.Value));
Microsoft.AspNetCore.Identity.UI (2)
Areas\Identity\Pages\V4\Account\ExternalLogin.cshtml.cs (1)
159if (info.Principal!.HasClaim(c => c.Type == ClaimTypes.Email))
Areas\Identity\Pages\V5\Account\ExternalLogin.cshtml.cs (1)
159if (info.Principal.HasClaim(c => c.Type == ClaimTypes.Email))
Microsoft.AspNetCore.SignalR.Tests (1)
TestAuthHandler.cs (1)
19var hasClaim = context.User.HasClaim(o => o.Type == ClaimTypes.NameIdentifier && !string.IsNullOrEmpty(o.Value));
Microsoft.Extensions.Identity.Stores (3)
IdentityRoleClaim.cs (1)
50ClaimType = other?.Type;
IdentityUserClaim.cs (1)
50ClaimType = claim.Type;
RoleStoreBase.cs (1)
247=> new TRoleClaim { RoleId = role.Id, ClaimType = claim.Type, ClaimValue = claim.Value };
OpenIdConnectSample (2)
Startup.cs (2)
319await WriteTableHeader(res, new string[] { "Claim Type", "Value" }, context.User.Claims.Select(c => new string[] { c.Type, c.Value })); 371identity.AddClaim(new Claim(claim.Type, claim.Value, claim.ValueType, issuer, claim.OriginalIssuer, claim.Subject));
SocialSample (1)
Startup.cs (1)
453await response.WriteAsync(claim.Type + ": " + claim.Value + "<br>");
System.Security.Claims (10)
System\Security\Claims\Claim.cs (1)
514/// The returned string contains the values of the <see cref="Type"/> and <see cref="Value"/> properties.
System\Security\Claims\ClaimsIdentity.cs (9)
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> 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> 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> 582if (string.Equals(claim.Type, type, StringComparison.OrdinalIgnoreCase)) 627if (string.Equals(claim.Type, type, StringComparison.OrdinalIgnoreCase)) 675&& string.Equals(claim.Type, type, StringComparison.OrdinalIgnoreCase)
WsFedSample (1)
Startup.cs (1)
124await WriteTableHeader(response, new string[] { "Claim Type", "Value" }, context.User.Claims.Select(c => new string[] { c.Type, c.Value }));