102 references to ClaimTypes
Aspire.Dashboard (4)
Authentication\UnsecuredAuthenticationHandler.cs (1)
21[new Claim(ClaimTypes.NameIdentifier, "Local"), new Claim(FrontendAuthorizationDefaults.UnsecuredClaimName, bool.TrueString)],
DashboardWebApplication.cs (2)
770new Claim(ClaimTypes.NameIdentifier, 773new Claim(ClaimTypes.Name,
Model\ValidateTokenMiddleware.cs (1)
94[new Claim(ClaimTypes.NameIdentifier, "Local")],
dotnet-user-jwts (1)
Helpers\JwtIssuer.cs (1)
41identity.AddClaims(rolesToAdd.Select(r => new Claim(ClaimTypes.Role, r)));
Microsoft.AspNetCore.Antiforgery (2)
Internal\DefaultClaimUidExtractor.cs (2)
60claim => string.Equals(ClaimTypes.NameIdentifier, claim.Type, StringComparison.Ordinal)); 72claim => string.Equals(ClaimTypes.Upn, claim.Type, StringComparison.Ordinal));
Microsoft.AspNetCore.Authentication.Certificate (8)
CertificateAuthenticationHandler.cs (8)
262claims.Add(new Claim(ClaimTypes.Thumbprint, thumbprint, ClaimValueTypes.Base64Binary, Options.ClaimsIssuer)); 267claims.Add(new Claim(ClaimTypes.X500DistinguishedName, value, ClaimValueTypes.String, Options.ClaimsIssuer)); 273claims.Add(new Claim(ClaimTypes.SerialNumber, value, ClaimValueTypes.String, Options.ClaimsIssuer)); 279claims.Add(new Claim(ClaimTypes.Dns, value, ClaimValueTypes.String, Options.ClaimsIssuer)); 285claims.Add(new Claim(ClaimTypes.Name, value, ClaimValueTypes.String, Options.ClaimsIssuer)); 291claims.Add(new Claim(ClaimTypes.Email, value, ClaimValueTypes.String, Options.ClaimsIssuer)); 297claims.Add(new Claim(ClaimTypes.Upn, value, ClaimValueTypes.String, Options.ClaimsIssuer)); 303claims.Add(new Claim(ClaimTypes.Uri, value, ClaimValueTypes.String, Options.ClaimsIssuer));
Microsoft.AspNetCore.Authentication.Facebook (8)
FacebookOptions.cs (8)
32ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "id"); 35ClaimActions.MapJsonKey(ClaimTypes.DateOfBirth, "birthday"); 36ClaimActions.MapJsonKey(ClaimTypes.Email, "email"); 37ClaimActions.MapJsonKey(ClaimTypes.Name, "name"); 38ClaimActions.MapJsonKey(ClaimTypes.GivenName, "first_name"); 40ClaimActions.MapJsonKey(ClaimTypes.Surname, "last_name"); 41ClaimActions.MapJsonKey(ClaimTypes.Gender, "gender"); 44ClaimActions.MapJsonKey(ClaimTypes.Locality, "locale");
Microsoft.AspNetCore.Authentication.Google (6)
GoogleOptions.cs (6)
29ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "id"); // v2 30ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "sub"); // v3 31ClaimActions.MapJsonKey(ClaimTypes.Name, "name"); 32ClaimActions.MapJsonKey(ClaimTypes.GivenName, "given_name"); 33ClaimActions.MapJsonKey(ClaimTypes.Surname, "family_name"); 35ClaimActions.MapJsonKey(ClaimTypes.Email, "email");
Microsoft.AspNetCore.Authentication.MicrosoftAccount (5)
MicrosoftAccountOptions.cs (5)
27ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "id"); 28ClaimActions.MapJsonKey(ClaimTypes.Name, "displayName"); 29ClaimActions.MapJsonKey(ClaimTypes.GivenName, "givenName"); 30ClaimActions.MapJsonKey(ClaimTypes.Surname, "surname"); 31ClaimActions.MapCustomJson(ClaimTypes.Email, user => user.GetString("mail") ?? user.GetString("userPrincipalName"));
Microsoft.AspNetCore.Authentication.Twitter (3)
TwitterHandler.cs (2)
109new Claim(ClaimTypes.NameIdentifier, accessToken.UserId, ClaimValueTypes.String, ClaimsIssuer), 110new Claim(ClaimTypes.Name, accessToken.ScreenName, ClaimValueTypes.String, ClaimsIssuer),
TwitterOptions.cs (1)
28ClaimActions.MapJsonKey(ClaimTypes.Email, "email", ClaimValueTypes.Email);
Microsoft.AspNetCore.Components.Authorization (1)
ClaimData.cs (1)
37/// Gets the claim type of the claim. <seealso cref="ClaimTypes"/>.
Microsoft.AspNetCore.Http.Connections (2)
Internal\HttpConnectionDispatcher.cs (2)
892var originalName = currentUser.FindFirst(ClaimTypes.NameIdentifier)?.Value; 893var newName = newPrincipal.FindFirst(ClaimTypes.NameIdentifier)?.Value;
Microsoft.AspNetCore.Identity (10)
SignInManager.cs (10)
210var authenticationMethod = auth.Principal?.FindFirst(ClaimTypes.AuthenticationMethod); 255additionalClaims.Add(new Claim(ClaimTypes.AuthenticationMethod, authenticationMethod)); 755return (result?.Principal != null && result.Principal.FindFirstValue(ClaimTypes.Name) == userId); 857claims.Add(new Claim(ClaimTypes.AuthenticationMethod, twoFactorInfo.LoginProvider)); 1108var providerKey = auth.Principal.FindFirstValue(ClaimTypes.NameIdentifier) ?? auth.Principal.FindFirstValue("sub"); 1180identity.AddClaim(new Claim(ClaimTypes.Name, userId)); 1183identity.AddClaim(new Claim(ClaimTypes.AuthenticationMethod, loginProvider)); 1192rememberBrowserIdentity.AddClaim(new Claim(ClaimTypes.Name, userId)); 1275var userId = result.Principal.FindFirstValue(ClaimTypes.Name); 1290LoginProvider = result.Principal.FindFirstValue(ClaimTypes.AuthenticationMethod),
Microsoft.AspNetCore.Identity.UI (4)
Areas\Identity\Pages\V4\Account\ExternalLogin.cshtml.cs (2)
159if (info.Principal!.HasClaim(c => c.Type == ClaimTypes.Email)) 163Email = info.Principal.FindFirstValue(ClaimTypes.Email)!
Areas\Identity\Pages\V5\Account\ExternalLogin.cshtml.cs (2)
159if (info.Principal.HasClaim(c => c.Type == ClaimTypes.Email)) 163Email = info.Principal.FindFirstValue(ClaimTypes.Email)!
Microsoft.AspNetCore.SignalR.Core (1)
DefaultUserIdProvider.cs (1)
17return connection.User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
Microsoft.AspNetCore.SignalR.Specification.Tests (2)
src\aspnetcore\src\SignalR\common\testassets\Tests.Utils\TestClient.cs (2)
53var claims = new List<Claim> { new Claim(ClaimTypes.Name, claimValue) }; 56claims.Add(new Claim(ClaimTypes.NameIdentifier, userIdentifier));
Microsoft.Extensions.Identity.Core (9)
ClaimsIdentityOptions.cs (8)
14/// Gets or sets the ClaimType used for a Role claim. Defaults to <see cref="ClaimTypes.Role"/>. 16public string RoleClaimType { get; set; } = ClaimTypes.Role; 19/// Gets or sets the ClaimType used for the user name claim. Defaults to <see cref="ClaimTypes.Name"/>. 21public string UserNameClaimType { get; set; } = ClaimTypes.Name; 24/// Gets or sets the ClaimType used for the user identifier claim. Defaults to <see cref="ClaimTypes.NameIdentifier"/>. 26public string UserIdClaimType { get; set; } = ClaimTypes.NameIdentifier; 29/// Gets or sets the ClaimType used for the user email claim. Defaults to <see cref="ClaimTypes.Email"/>. 31public string EmailClaimType { get; set; } = ClaimTypes.Email;
UserManager.cs (1)
442/// <remarks>The User ID claim is identified by <see cref="ClaimTypes.NameIdentifier"/>.</remarks>
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
854[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Claims.ClaimTypes))]
netstandard (1)
netstandard.cs (1)
1838[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Claims.ClaimTypes))]
System.Security.Claims (8)
System\Security\Claims\Claim.cs (6)
154/// <seealso cref="ClaimTypes"/> 174/// <seealso cref="ClaimTypes"/> 194/// <seealso cref="ClaimTypes"/> 214/// <seealso cref="ClaimTypes"/> 232/// <seealso cref="ClaimTypes"/> 356/// <seealso cref="ClaimTypes"/>.
System\Security\Claims\ClaimsIdentity.cs (2)
44public const string DefaultNameClaimType = ClaimTypes.Name; 45public const string DefaultRoleClaimType = ClaimTypes.Role;
System.Security.Principal.Windows (26)
System\Security\Principal\WindowsIdentity.cs (26)
104: base(null, null, null, ClaimTypes.Name, ClaimTypes.GroupSid) 112: base(null, null, null, ClaimTypes.Name, ClaimTypes.GroupSid) 118: base(null, null, null, ClaimTypes.Name, ClaimTypes.GroupSid) 131: base(null, null, null, ClaimTypes.Name, ClaimTypes.GroupSid) 1069AddTokenClaims(_userClaims, TokenInformationClass.TokenUserClaimAttributes, ClaimTypes.WindowsUserClaim); 1072AddTokenClaims(_deviceClaims, TokenInformationClass.TokenDeviceClaimAttributes, ClaimTypes.WindowsDeviceClaim); 1117claim = new Claim(ClaimTypes.PrimaryGroupSid, groupSid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this); 1118claim.Properties.Add(ClaimTypes.WindowsSubAuthority, groupSid.IdentifierAuthority.ToString()); 1123claim = new Claim(ClaimTypes.GroupSid, groupSid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this); 1124claim.Properties.Add(ClaimTypes.WindowsSubAuthority, groupSid.IdentifierAuthority.ToString()); 1131claim = new Claim(ClaimTypes.DenyOnlyPrimaryGroupSid, groupSid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this); 1132claim.Properties.Add(ClaimTypes.WindowsSubAuthority, groupSid.IdentifierAuthority.ToString()); 1137claim = new Claim(ClaimTypes.DenyOnlySid, groupSid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this); 1138claim.Properties.Add(ClaimTypes.WindowsSubAuthority, groupSid.IdentifierAuthority.ToString()); 1170claim = new Claim(ClaimTypes.PrimarySid, sid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this); 1171claim.Properties.Add(ClaimTypes.WindowsSubAuthority, sid.IdentifierAuthority.ToString()); 1176claim = new Claim(ClaimTypes.DenyOnlyPrimarySid, sid.Value, ClaimValueTypes.String, _issuerName, _issuerName, this); 1177claim.Properties.Add(ClaimTypes.WindowsSubAuthority, sid.IdentifierAuthority.ToString()); 1217claimType = ClaimTypes.WindowsDeviceGroup; 1219claim.Properties.Add(ClaimTypes.WindowsSubAuthority, groupSid.IdentifierAuthority.ToString()); 1225claimType = ClaimTypes.DenyOnlyWindowsDeviceGroup; 1227claim.Properties.Add(ClaimTypes.WindowsSubAuthority, groupSid.IdentifierAuthority.ToString());