119 references to Value
CustomPolicyProvider (2)
Authorization\MinimumAgeAuthorizationHandler.cs (2)
36var dateOfBirth = Convert.ToDateTime(dateOfBirthClaim.Value, CultureInfo.InvariantCulture); 53dateOfBirthClaim.Value,
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(); 53matchedClaim.ClaimValue = newClaim.Value; 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.Antiforgery (7)
Internal\DefaultClaimUidExtractor.cs (7)
57if (subClaim != null && !string.IsNullOrEmpty(subClaim.Value)) 62subClaim.Value, 69if (nameIdentifierClaim != null && !string.IsNullOrEmpty(nameIdentifierClaim.Value)) 74nameIdentifierClaim.Value, 81if (upnClaim != null && !string.IsNullOrEmpty(upnClaim.Value)) 86upnClaim.Value, 115identifierParameters.Add(claim.Value);
Microsoft.AspNetCore.Antiforgery.Test (1)
DefaultClaimUidExtractorTest.cs (1)
74Assert.Equal(identiferParameters[index++], claim.Value);
Microsoft.AspNetCore.Authentication (1)
TicketSerializer.cs (1)
126writer.Write(claim.Value);
Microsoft.AspNetCore.Authentication.Cookies (2)
CookieAuthenticationHandler.cs (2)
172ticket = await Options.SessionStore.RetrieveAsync(claim.Value, Context, Context.RequestAborted); 177_sessionKey = claim.Value;
Microsoft.AspNetCore.Authentication.Negotiate.Test (1)
NegotiateHandlerTests.cs (1)
449&& claim.Value == "CN=Domain Admins,CN=Users,DC=domain,DC=net");
Microsoft.AspNetCore.Authentication.OAuth (2)
ClaimAction.cs (1)
26/// Gets the value to use for <see cref="Claim.Value"/>when creating a Claim.
MapAllClaimsAction.cs (1)
32&& string.Equals(c.Value, claimValue, StringComparison.Ordinal)) != null;
Microsoft.AspNetCore.Authentication.OpenIdConnect (4)
OpenIdConnectHandler.cs (2)
163var sid = principal?.FindFirst(JwtRegisteredClaimNames.Sid)?.Value; 180var iss = principal?.FindFirst(JwtRegisteredClaimNames.Iss)?.Value;
UniqueJsonKeyClaimAction.cs (2)
40if (claim != null && string.Equals(claim.Value, value, StringComparison.Ordinal)) 52if (claim != null && string.Equals(claim.Value, value, StringComparison.Ordinal))
Microsoft.AspNetCore.Authentication.Test (25)
CertificateTests.cs (1)
833await response.WriteAsync($"<claim Type=\"{claim.Type}\" Issuer=\"{claim.Issuer}\">{claim.Value}</claim>");
ClaimActionTests.cs (8)
23Assert.Equal("test", identity.FindFirst("name").Value); 39Assert.Equal("role1", roleClaims[0].Value); 41Assert.Equal("role2", roleClaims[1].Value); 55Assert.Equal("test", identity.FindFirst("name").Value); 71Assert.Equal("role1", roleClaims[0].Value); 73Assert.Equal("role2", roleClaims[1].Value); 86Assert.Equal("value0", identity.FindFirst("name0").Value); 88Assert.Equal("value1", identity.FindFirst("name1").Value);
CookieTests.cs (3)
783id.AddClaim(new Claim("counter", claim.Value + "1")); 839id.AddClaim(new Claim("counter", claim.Value + "1")); 1893xml.Add(result.Ticket.Principal.Claims.Select(claim => new XElement("claim", new XAttribute("type", claim.Type), new XAttribute("value", claim.Value))));
GoogleTests.cs (5)
785Assert.Equal("Test email", context.Identity.FindFirst(ClaimTypes.Email)?.Value); 786Assert.Equal("Test User ID", context.Identity.FindFirst(ClaimTypes.NameIdentifier)?.Value); 787Assert.Equal("Test Name", context.Identity.FindFirst(ClaimTypes.Name)?.Value); 788Assert.Equal("Test Family Name", context.Identity.FindFirst(ClaimTypes.Surname)?.Value); 789Assert.Equal("Test Given Name", context.Identity.FindFirst(ClaimTypes.GivenName)?.Value);
JwtBearerTests.cs (2)
496Assert.Equal("Bob le Tout Puissant", identifier.Value); 1202await context.Response.WriteAsync(identifier.Value);
JwtBearerTests_Handler.cs (2)
473Assert.Equal("Bob le Tout Puissant", identifier.Value); 1234await context.Response.WriteAsync(identifier.Value);
OpenIdConnect\UniqueJsonKeyClaimActionTests.cs (2)
25Assert.Equal("value", claim.Value); 42Assert.Equal("value", claims.First().Value);
TestExtensions.cs (1)
56new XAttribute("value", claim.Value),
TicketSerializerTests.cs (1)
112Assert.Equal("value", claim.Value);
Microsoft.AspNetCore.Authorization (1)
ClaimsAuthorizationRequirement.cs (1)
72&& requirement.AllowedValues!.Contains(claim.Value, StringComparer.Ordinal))
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.Http.Connections (2)
Internal\HttpConnectionDispatcher.cs (2)
641var originalName = connection.User.FindFirst(ClaimTypes.NameIdentifier)?.Value; 642var newName = connection.HttpContext?.User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
Microsoft.AspNetCore.Http.Connections.Tests (1)
HttpConnectionDispatcherTests.cs (1)
824Assert.Equal("claimValue", connectionHttpContext.User.Claims.FirstOrDefault().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); 336matchedClaim.ClaimValue = newClaim.Value; 355var matchedClaims = await UserClaims.Where(uc => uc.UserId.Equals(user.Id) && uc.ClaimValue == claim.Value && uc.ClaimType == claim.Type).ToListAsync(cancellationToken); 474where userclaims.ClaimValue == claim.Value
UserStore.cs (4)
448var matchedClaims = await UserClaims.Where(uc => uc.UserId.Equals(user.Id) && uc.ClaimValue == claim.Value && uc.ClaimType == claim.Type).ToListAsync(cancellationToken); 451matchedClaim.ClaimValue = newClaim.Value; 470var matchedClaims = await UserClaims.Where(uc => uc.UserId.Equals(user.Id) && uc.ClaimValue == claim.Value && uc.ClaimType == claim.Type).ToListAsync(cancellationToken); 589where userclaims.ClaimValue == claim.Value
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (8)
UserStoreWithGenericsTest.cs (8)
169Assert.Equal(claim.Value, newClaim.Value); 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 }; 273ClaimValue = other.Value; 290ClaimValue = other.Value;
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(); 53matchedClaim.ClaimValue = newClaim.Value; 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)
781Assert.Equal(claim.Value, newClaim.Value); 809Assert.Equal(claim.Value, newClaim.Value); 814Assert.Equal("a", oldClaim2.Value);
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.SignalR.Core (1)
DefaultUserIdProvider.cs (1)
17return connection.User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
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.Core (1)
PrincipalExtensions.cs (1)
23return claim?.Value;
Microsoft.Extensions.Identity.Stores (3)
IdentityRoleClaim.cs (1)
51ClaimValue = other?.Value;
IdentityUserClaim.cs (1)
51ClaimValue = claim.Value;
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 (4)
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 (3)
367/// <remarks>Calls <see cref="FindFirst(string)"/> where string == NameClaimType, if found, returns <see cref="Claim.Value"/> otherwise null.</remarks> 376return claim.Value; 676&& string.Equals(claim.Value, value, StringComparison.Ordinal))
WsFedSample (1)
Startup.cs (1)
124await WriteTableHeader(response, new string[] { "Claim Type", "Value" }, context.User.Claims.Select(c => new string[] { c.Type, c.Value }));