2 types derived from ClaimsPrincipal
System.Security.Claims (1)
System\Security\Claims\GenericPrincipal.cs (1)
10public class GenericPrincipal : ClaimsPrincipal
System.Security.Principal.Windows (1)
System\Security\Principal\WindowsPrincipal.cs (1)
25public class WindowsPrincipal : ClaimsPrincipal
56 instantiations of ClaimsPrincipal
Aspire.Dashboard (9)
Api\ApiAuthenticationHandler.cs (3)
40return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), Scheme.Name))); 72return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), Scheme.Name))); 80return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), Scheme.Name)));
Authentication\AspirePolicyEvaluator.cs (2)
76context.User = new ClaimsPrincipal(new ClaimsIdentity()); 134var newPrincipal = new ClaimsPrincipal();
Authentication\OtlpCompositeAuthenticationHandler.cs (1)
38return AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), Scheme.Name));
Authentication\UnsecuredAuthenticationHandler.cs (1)
24return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), Scheme.Name)));
DashboardWebApplication.cs (1)
898context.Principal = new ClaimsPrincipal(new ClaimsIdentity(claims, context.Scheme.Name));
Model\ValidateTokenMiddleware.cs (1)
99var claims = new ClaimsPrincipal(claimsIdentity);
Aspire.Dashboard.Tests (1)
Terminal\TerminalWebSocketProxyEndpointTests.cs (1)
271var principal = new ClaimsPrincipal(identity);
Aspire.Hosting (1)
Dashboard\DashboardServiceAuth.cs (1)
60principal: new ClaimsPrincipal(new ClaimsIdentity(
Microsoft.AspNetCore.Authentication (2)
src\aspnetcore\src\Shared\SecurityHelper\SecurityHelper.cs (1)
31var newPrincipal = new ClaimsPrincipal();
TicketSerializer.cs (1)
185return new AuthenticationTicket(new ClaimsPrincipal(identities), properties, scheme);
Microsoft.AspNetCore.Authentication.Abstractions (1)
AuthenticationTicket.cs (1)
61var principal = new ClaimsPrincipal();
Microsoft.AspNetCore.Authentication.Certificate (1)
CertificateAuthenticationHandler.cs (1)
307return new ClaimsPrincipal(identity);
Microsoft.AspNetCore.Authentication.Cookies (3)
CookieAuthenticationHandler.cs (3)
136var newPrincipal = new ClaimsPrincipal(); 266var principal = new ClaimsPrincipal( 350var principal = new ClaimsPrincipal(
Microsoft.AspNetCore.Authentication.Facebook (1)
FacebookHandler.cs (1)
60var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);
Microsoft.AspNetCore.Authentication.Google (1)
GoogleHandler.cs (1)
58var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);
Microsoft.AspNetCore.Authentication.JwtBearer (1)
JwtBearerHandler.cs (1)
110principal = new ClaimsPrincipal(tokenValidationResult.ClaimsIdentity);
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
MicrosoftAccountHandler.cs (1)
54var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);
Microsoft.AspNetCore.Authentication.Negotiate (1)
NegotiateHandler.cs (1)
332user = new ClaimsPrincipal(new ClaimsIdentity(identity));
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthHandler.cs (1)
256var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, user.RootElement);
Microsoft.AspNetCore.Authentication.OpenIdConnect (2)
OpenIdConnectHandler.cs (2)
778user = new ClaimsPrincipal(tokenValidationResult.ClaimsIdentity); 859tokenEndpointUser = new ClaimsPrincipal(tokenValidationResult.ClaimsIdentity);
Microsoft.AspNetCore.Authentication.Twitter (1)
TwitterHandler.cs (1)
157var context = new TwitterCreatingTicketContext(Context, Scheme, Options, new ClaimsPrincipal(identity), properties, token.UserId, token.ScreenName, token.Token, token.TokenSecret, user);
Microsoft.AspNetCore.Authentication.WsFederation (1)
WsFederationHandler.cs (1)
257principal = new ClaimsPrincipal(tokenValidationResult.ClaimsIdentity);
Microsoft.AspNetCore.Authorization (1)
src\aspnetcore\src\Shared\SecurityHelper\SecurityHelper.cs (1)
31var newPrincipal = new ClaimsPrincipal();
Microsoft.AspNetCore.Authorization.Policy (2)
PolicyEvaluator.cs (1)
65context.User = new ClaimsPrincipal(new ClaimsIdentity());
src\aspnetcore\src\Shared\SecurityHelper\SecurityHelper.cs (1)
31var newPrincipal = new ClaimsPrincipal();
Microsoft.AspNetCore.Components.Server (2)
Circuits\RevalidatingServerAuthenticationStateProvider.cs (1)
105var anonymousUser = new ClaimsPrincipal(new ClaimsIdentity());
src\aspnetcore\src\Shared\SecurityHelper\SecurityHelper.cs (1)
31var newPrincipal = new ClaimsPrincipal();
Microsoft.AspNetCore.Components.WebAssembly.Authentication (5)
Options\AuthenticationStateDeserializationOptions.cs (2)
16Task.FromResult(new AuthenticationState(new ClaimsPrincipal(new ClaimsIdentity()))); 33new AuthenticationState(new ClaimsPrincipal(
Services\AccountClaimsPrincipalFactory.cs (1)
58return new ValueTask<ClaimsPrincipal>(new ClaimsPrincipal(identity));
Services\DeserializedAuthenticationStateProvider.cs (1)
18Task.FromResult(new AuthenticationState(new ClaimsPrincipal(new ClaimsIdentity())));
Services\RemoteAuthenticationService.cs (1)
38private ClaimsPrincipal _cachedUser = new ClaimsPrincipal(new ClaimsIdentity());
Microsoft.AspNetCore.Http (1)
DefaultHttpContext.cs (1)
161user = new ClaimsPrincipal(new ClaimsIdentity());
Microsoft.AspNetCore.Http.Connections (3)
Internal\HttpConnectionContext.cs (1)
342previousUserSnapshot = previousUserReference ?? new ClaimsPrincipal(new ClaimsIdentity());
Internal\HttpConnectionDispatcher.cs (1)
984newContext.User = new ClaimsPrincipal();
src\aspnetcore\src\Shared\SecurityHelper\SecurityHelper.cs (1)
31var newPrincipal = new ClaimsPrincipal();
Microsoft.AspNetCore.Identity (3)
SignInManager.cs (3)
930var claimsPrincipal = new ClaimsPrincipal(claimsIdentity); 1416return new ClaimsPrincipal(identity); 1429return new ClaimsPrincipal(rememberBrowserIdentity);
Microsoft.AspNetCore.Mvc.Core (1)
src\aspnetcore\src\Shared\SecurityHelper\SecurityHelper.cs (1)
31var newPrincipal = new ClaimsPrincipal();
Microsoft.AspNetCore.OutputCaching (1)
src\aspnetcore\src\Shared\SecurityHelper\SecurityHelper.cs (1)
31var newPrincipal = new ClaimsPrincipal();
Microsoft.AspNetCore.Owin (1)
Utilities.cs (1)
43return new ClaimsPrincipal(principal);
Microsoft.AspNetCore.SignalR.Core (4)
HubConnectionContext.cs (3)
156return HubCallerContext.User ?? new ClaimsPrincipal(); 192_connectionContext.Features.Get<IConnectionUserFeature>()?.User ?? new ClaimsPrincipal()); 708var user = Features.Get<IConnectionUserFeature>()?.User ?? new ClaimsPrincipal();
Internal\DefaultHubDispatcher.cs (1)
773hubCallerContext.User ?? new ClaimsPrincipal(),
Microsoft.AspNetCore.SignalR.Specification.Tests (1)
parent\parent\parent\common\testassets\Tests.Utils\TestClient.cs (1)
59Connection.User = new ClaimsPrincipal(new ClaimsIdentity(claims));
Microsoft.Extensions.Identity.Core (1)
UserClaimsPrincipalFactory.cs (1)
63return new ClaimsPrincipal(id);
System.Security.Claims (2)
System\Security\Claims\ClaimsPrincipal.cs (2)
45not null => new ClaimsPrincipal(threadPrincipal), 246return new ClaimsPrincipal(this);
458 references to ClaimsPrincipal
Aspire.Dashboard (7)
Authentication\AspirePolicyEvaluator.cs (6)
33/// <see cref="ClaimsPrincipal"/> to <see cref="HttpContext.User"/>. If no schemes are set, this is a no-op. 42ClaimsPrincipal? newPrincipal = null; 126private static ClaimsPrincipal MergeUserPrincipal(ClaimsPrincipal? existingPrincipal, ClaimsPrincipal? additionalPrincipal) 134var newPrincipal = new ClaimsPrincipal();
Model\ValidateTokenMiddleware.cs (1)
99var claims = new ClaimsPrincipal(claimsIdentity);
Aspire.Dashboard.Tests (1)
Terminal\TerminalWebSocketProxyEndpointTests.cs (1)
271var principal = new ClaimsPrincipal(identity);
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\System\ServiceModel\OperationContext.cs (1)
279public ClaimsPrincipal ClaimsPrincipal
Microsoft.AspNetCore.Antiforgery (4)
Internal\DefaultAntiforgeryTokenGenerator.cs (1)
223private static ClaimsIdentity? GetAuthenticatedIdentity(ClaimsPrincipal? claimsPrincipal)
Internal\DefaultClaimUidExtractor.cs (1)
17public bool TryExtractClaimUidBytes(ClaimsPrincipal claimsPrincipal, Span<byte> destination)
Internal\IClaimUidExtractor.cs (2)
9/// This interface can extract unique identifiers for a <see cref="ClaimsPrincipal"/>. 16bool TryExtractClaimUidBytes(ClaimsPrincipal claimsPrincipal, Span<byte> destination);
Microsoft.AspNetCore.Authentication (20)
AuthenticationFeatures.cs (2)
14private ClaimsPrincipal? _user; 32public ClaimsPrincipal? User
Events\PrincipalContext.cs (2)
25/// Gets the <see cref="ClaimsPrincipal"/> containing the user claims. 27public virtual ClaimsPrincipal? Principal { get; set; }
Events\RemoteAuthenticationContext.cs (2)
30/// Gets the <see cref="ClaimsPrincipal"/> containing the user claims. 32public ClaimsPrincipal? Principal { get; set; }
Events\ResultContext.cs (2)
26/// Gets or sets the <see cref="ClaimsPrincipal"/> containing the user claims. 28public ClaimsPrincipal? Principal { get; set; }
PolicySchemeHandler.cs (1)
45protected override Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties)
SignInAuthenticationHandler.cs (2)
38public virtual Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 52protected abstract Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties);
src\aspnetcore\src\Shared\SecurityHelper\SecurityHelper.cs (8)
21/// <param name="existingPrincipal">The <see cref="ClaimsPrincipal"/> containing existing <see cref="ClaimsIdentity"/>.</param> 22/// <param name="additionalPrincipal">The <see cref="ClaimsPrincipal"/> containing <see cref="ClaimsIdentity"/> to be added.</param> 23public static ClaimsPrincipal MergeUserPrincipal(ClaimsPrincipal? existingPrincipal, ClaimsPrincipal? additionalPrincipal) 31var newPrincipal = new ClaimsPrincipal(); 53/// <param name="user">The <see cref="ClaimsPrincipal"/> to inspect.</param> 55public static bool IsAuthenticated(ClaimsPrincipal? user)
TicketSerializer.cs (1)
70var principal = ticket.Principal;
Microsoft.AspNetCore.Authentication.Abstractions (23)
AuthenticateResult.cs (1)
35public ClaimsPrincipal? Principal => Ticket?.Principal;
AuthenticationHttpContextExtensions.cs (4)
125public static Task SignInAsync(this HttpContext context, string? scheme, ClaimsPrincipal principal) => 135public static Task SignInAsync(this HttpContext context, ClaimsPrincipal principal) => 146public static Task SignInAsync(this HttpContext context, ClaimsPrincipal principal, AuthenticationProperties? properties) => 157public static Task SignInAsync(this HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties) =>
AuthenticationOptions.cs (2)
74/// Used as the default scheme by <see cref="IAuthenticationService.SignInAsync(HttpContext, string, System.Security.Claims.ClaimsPrincipal, AuthenticationProperties)"/>. 95/// A user is considered authenticated if <see cref="ClaimsIdentity.IsAuthenticated"/> returns <see langword="true" /> for the <see cref="ClaimsPrincipal"/> associated with the HTTP request.
AuthenticationTicket.cs (7)
16/// <param name="principal">the <see cref="ClaimsPrincipal"/> that represents the authenticated user.</param> 19public AuthenticationTicket(ClaimsPrincipal principal, AuthenticationProperties? properties, string authenticationScheme) 31/// <param name="principal">the <see cref="ClaimsPrincipal"/> that represents the authenticated user.</param> 33public AuthenticationTicket(ClaimsPrincipal principal, string authenticationScheme) 45public ClaimsPrincipal Principal { get; } 56/// The method clones the <see cref="Principal"/> by calling <see cref="ClaimsIdentity.Clone"/> on each of the <see cref="ClaimsPrincipal.Identities"/>. 61var principal = new ClaimsPrincipal();
IAuthenticationSchemeProvider.cs (2)
51/// Returns the scheme that will be used by default for <see cref="IAuthenticationService.SignInAsync(HttpContext, string, System.Security.Claims.ClaimsPrincipal, AuthenticationProperties)"/>. 55/// <returns>The scheme that will be used by default for <see cref="IAuthenticationService.SignInAsync(HttpContext, string, System.Security.Claims.ClaimsPrincipal, AuthenticationProperties)"/>.</returns>
IAuthenticationService.cs (2)
47/// <param name="principal">The <see cref="ClaimsPrincipal"/> to sign in.</param> 50Task SignInAsync(HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties);
IAuthenticationSignInHandler.cs (2)
16/// <param name="user">The <see cref="ClaimsPrincipal"/> user.</param> 19Task SignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties);
IClaimsTransformation.cs (3)
18/// <param name="principal">The <see cref="ClaimsPrincipal"/> to transform.</param> 20Task<ClaimsPrincipal> TransformAsync(ClaimsPrincipal principal);
Microsoft.AspNetCore.Authentication.BearerToken (7)
BearerTokenExtensions.cs (4)
20/// Bearer tokens can be obtained by calling <see cref="AuthenticationHttpContextExtensions.SignInAsync(AspNetCore.Http.HttpContext, string?, System.Security.Claims.ClaimsPrincipal)" />. 31/// Bearer tokens can be obtained by calling <see cref="AuthenticationHttpContextExtensions.SignInAsync(AspNetCore.Http.HttpContext, string?, System.Security.Claims.ClaimsPrincipal)" />. 43/// Bearer tokens can be obtained by calling <see cref="AuthenticationHttpContextExtensions.SignInAsync(AspNetCore.Http.HttpContext, string?, System.Security.Claims.ClaimsPrincipal)" />. 55/// Bearer tokens can be obtained by calling <see cref="AuthenticationHttpContextExtensions.SignInAsync(AspNetCore.Http.HttpContext, string?, System.Security.Claims.ClaimsPrincipal)" />.
BearerTokenHandler.cs (3)
64protected override async Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 103private AuthenticationTicket CreateBearerTicket(ClaimsPrincipal user, AuthenticationProperties properties) 106private AuthenticationTicket CreateRefreshTicket(ClaimsPrincipal user, DateTimeOffset utcNow)
Microsoft.AspNetCore.Authentication.Certificate (6)
CertificateAuthenticationExtensions.cs (5)
20/// raises an event where the certificate is resolved to a <see cref="ClaimsPrincipal"/>. 33/// raises an event where the certificate is resolved to a <see cref="ClaimsPrincipal"/>. 47/// raises an event where the certificate is resolved to a <see cref="ClaimsPrincipal"/>. 61/// raises an event where the certificate is resolved to a <see cref="ClaimsPrincipal"/>. 79/// raises an event where the certificate is resolved to a <see cref="ClaimsPrincipal"/>.
CertificateAuthenticationHandler.cs (1)
254private ClaimsPrincipal CreatePrincipal(X509Certificate2 certificate)
Microsoft.AspNetCore.Authentication.Cookies (11)
CookieAuthenticationHandler.cs (7)
117private void RequestRefresh(AuthenticationTicket ticket, ClaimsPrincipal? replacedPrincipal = null) 133private static AuthenticationTicket CloneTicket(AuthenticationTicket ticket, ClaimsPrincipal? replacedPrincipal) 135var principal = replacedPrincipal ?? ticket.Principal; 136var newPrincipal = new ClaimsPrincipal(); 266var principal = new ClaimsPrincipal( 292protected override async Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties) 350var principal = new ClaimsPrincipal(
CookieSignedInContext.cs (1)
25ClaimsPrincipal principal,
CookieSigningInContext.cs (1)
27ClaimsPrincipal principal,
CookieValidatePrincipalContext.cs (2)
38/// <param name="principal">The <see cref="ClaimsPrincipal"/> used as the replacement</param> 39public void ReplacePrincipal(ClaimsPrincipal principal) => Principal = principal;
Microsoft.AspNetCore.Authentication.Core (9)
AuthenticationSchemeProvider.cs (2)
96/// Returns the scheme that will be used by default for <see cref="IAuthenticationService.SignInAsync(HttpContext, string, System.Security.Claims.ClaimsPrincipal, AuthenticationProperties)"/>. 100/// <returns>The scheme that will be used by default for <see cref="IAuthenticationService.SignInAsync(HttpContext, string, System.Security.Claims.ClaimsPrincipal, AuthenticationProperties)"/>.</returns>
AuthenticationService.cs (4)
16private HashSet<ClaimsPrincipal>? _transformCache; 82var principal = result.Principal!; 152/// <param name="principal">The <see cref="ClaimsPrincipal"/> to sign in.</param> 155public virtual async Task SignInAsync(HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties)
AuthenticationServiceImpl.cs (1)
67public override async Task SignInAsync(HttpContext context, string? scheme, ClaimsPrincipal principal, AuthenticationProperties? properties)
NoopClaimsTransformation.cs (2)
18public virtual Task<ClaimsPrincipal> TransformAsync(ClaimsPrincipal principal)
Microsoft.AspNetCore.Authentication.JwtBearer (1)
JwtBearerHandler.cs (1)
99ClaimsPrincipal? principal = null;
Microsoft.AspNetCore.Authentication.Negotiate (1)
NegotiateHandler.cs (1)
324ClaimsPrincipal user;
Microsoft.AspNetCore.Authentication.OAuth (2)
Events\OAuthCreatingTicketContext.cs (2)
20/// <param name="principal">The <see cref="ClaimsPrincipal"/>.</param> 29ClaimsPrincipal principal,
Microsoft.AspNetCore.Authentication.OpenIdConnect (14)
Events\TokenResponseReceivedContext.cs (1)
18public TokenResponseReceivedContext(HttpContext context, AuthenticationScheme scheme, OpenIdConnectOptions options, ClaimsPrincipal user, AuthenticationProperties properties)
Events\TokenValidatedContext.cs (1)
24public TokenValidatedContext(HttpContext context, AuthenticationScheme scheme, OpenIdConnectOptions options, ClaimsPrincipal principal, AuthenticationProperties properties)
Events\UserInformationReceivedContext.cs (1)
24public UserInformationReceivedContext(HttpContext context, AuthenticationScheme scheme, OpenIdConnectOptions options, ClaimsPrincipal principal, AuthenticationProperties properties)
OpenIdConnectHandler.cs (11)
170var principal = (await Context.AuthenticateAsync(Options.SignOutScheme))?.Principal; 765ClaimsPrincipal? user = null; 853ClaimsPrincipal tokenEndpointUser; 1048ClaimsPrincipal principal, AuthenticationProperties properties) 1116/// Save the tokens contained in the <see cref="OpenIdConnectMessage"/> in the <see cref="ClaimsPrincipal"/>. 1239private async Task<TokenValidatedContext> RunTokenValidatedEventAsync(OpenIdConnectMessage authorizationResponse, OpenIdConnectMessage? tokenEndpointResponse, ClaimsPrincipal user, AuthenticationProperties properties, JwtSecurityToken jwt, string? nonce) 1265private async Task<AuthorizationCodeReceivedContext> RunAuthorizationCodeReceivedEventAsync(OpenIdConnectMessage authorizationResponse, ClaimsPrincipal? user, AuthenticationProperties properties, JwtSecurityToken? jwt) 1314ClaimsPrincipal user, 1340private async Task<UserInformationReceivedContext> RunUserInformationReceivedEventAsync(ClaimsPrincipal principal, AuthenticationProperties properties, OpenIdConnectMessage message, JsonDocument user) 1391private ClaimsPrincipal ValidateToken(string idToken, AuthenticationProperties properties, TokenValidationParameters validationParameters, out JwtSecurityToken jwt) 1411var principal = Options.SecurityTokenValidator.ValidateToken(idToken, validationParameters, out SecurityToken validatedToken);
Microsoft.AspNetCore.Authentication.Twitter (2)
TwitterCreatingTicketContext.cs (2)
21/// <param name="principal">The <see cref="ClaimsPrincipal"/>.</param> 32ClaimsPrincipal principal,
Microsoft.AspNetCore.Authentication.WsFederation (2)
SecurityTokenValidatedContext.cs (1)
19public SecurityTokenValidatedContext(HttpContext context, AuthenticationScheme scheme, WsFederationOptions options, ClaimsPrincipal principal, AuthenticationProperties properties)
WsFederationHandler.cs (1)
246ClaimsPrincipal? principal = null;
Microsoft.AspNetCore.Authorization (28)
AuthorizationFailure.cs (1)
11/// Encapsulates a failure result of <see cref="IAuthorizationService.AuthorizeAsync(ClaimsPrincipal, object, IEnumerable{IAuthorizationRequirement})"/>.
AuthorizationHandlerContext.cs (4)
26/// <param name="user">A <see cref="ClaimsPrincipal"/> representing the current user.</param> 30ClaimsPrincipal user, 47/// The <see cref="ClaimsPrincipal"/> representing the current user. 49public virtual ClaimsPrincipal User { get; }
AuthorizationMetrics.cs (2)
33public void AuthorizeAttemptCompleted(ClaimsPrincipal user, string? policyName, AuthorizationResult? result, Exception? exception) 42private void AuthorizeAttemptCore(ClaimsPrincipal user, string? policyName, AuthorizationResult? result, Exception? exception)
AuthorizationResult.cs (1)
11/// Encapsulates the result of <see cref="IAuthorizationService.AuthorizeAsync(ClaimsPrincipal, object, IEnumerable{IAuthorizationRequirement})"/>.
AuthorizationServiceExtensions.cs (4)
27public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService service, ClaimsPrincipal user, object? resource, IAuthorizationRequirement requirement) 46public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService service, ClaimsPrincipal user, object? resource, AuthorizationPolicy policy) 64public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService service, ClaimsPrincipal user, AuthorizationPolicy policy) 82public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService service, ClaimsPrincipal user, string policyName)
DefaultAuthorizationHandlerContextFactory.cs (1)
24public virtual AuthorizationHandlerContext CreateContext(IEnumerable<IAuthorizationRequirement> requirements, ClaimsPrincipal user, object? resource)
DefaultAuthorizationService.cs (2)
62public virtual async Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object? resource, IEnumerable<IAuthorizationRequirement> requirements) 99public virtual async Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object? resource, string policyName)
DefaultAuthorizationServiceImpl.cs (2)
24public override async Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object? resource, IEnumerable<IAuthorizationRequirement> requirements) 41public override async Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object? resource, string policyName)
IAuthorizationHandlerContextFactory.cs (1)
24AuthorizationHandlerContext CreateContext(IEnumerable<IAuthorizationRequirement> requirements, ClaimsPrincipal user, object? resource);
IAuthorizationService.cs (2)
32Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object? resource, IEnumerable<IAuthorizationRequirement> requirements); 51Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object? resource, string policyName);
src\aspnetcore\src\Shared\SecurityHelper\SecurityHelper.cs (8)
21/// <param name="existingPrincipal">The <see cref="ClaimsPrincipal"/> containing existing <see cref="ClaimsIdentity"/>.</param> 22/// <param name="additionalPrincipal">The <see cref="ClaimsPrincipal"/> containing <see cref="ClaimsIdentity"/> to be added.</param> 23public static ClaimsPrincipal MergeUserPrincipal(ClaimsPrincipal? existingPrincipal, ClaimsPrincipal? additionalPrincipal) 31var newPrincipal = new ClaimsPrincipal(); 53/// <param name="user">The <see cref="ClaimsPrincipal"/> to inspect.</param> 55public static bool IsAuthenticated(ClaimsPrincipal? user)
Microsoft.AspNetCore.Authorization.Policy (13)
AuthenticationFeatures.cs (2)
15private ClaimsPrincipal? _user; 33public ClaimsPrincipal? User
IPolicyEvaluator.cs (1)
17/// <see cref="ClaimsPrincipal"/> to <see cref="HttpContext.User"/>. If no schemes are set, this is a no-op.
PolicyEvaluator.cs (2)
29/// <see cref="ClaimsPrincipal"/> to <see cref="HttpContext.User"/>. If no schemes are set, this is a no-op. 38ClaimsPrincipal? newPrincipal = null;
src\aspnetcore\src\Shared\SecurityHelper\SecurityHelper.cs (8)
21/// <param name="existingPrincipal">The <see cref="ClaimsPrincipal"/> containing existing <see cref="ClaimsIdentity"/>.</param> 22/// <param name="additionalPrincipal">The <see cref="ClaimsPrincipal"/> containing <see cref="ClaimsIdentity"/> to be added.</param> 23public static ClaimsPrincipal MergeUserPrincipal(ClaimsPrincipal? existingPrincipal, ClaimsPrincipal? additionalPrincipal) 31var newPrincipal = new ClaimsPrincipal(); 53/// <param name="user">The <see cref="ClaimsPrincipal"/> to inspect.</param> 55public static bool IsAuthenticated(ClaimsPrincipal? user)
Microsoft.AspNetCore.Components.Authorization (6)
AuthenticationState.cs (4)
16/// <param name="user">A <see cref="ClaimsPrincipal"/> representing the user.</param> 17public AuthenticationState(ClaimsPrincipal user) 24/// Gets a <see cref="ClaimsPrincipal"/> that describes the current user. 26public ClaimsPrincipal User { get; }
AuthenticationStateData.cs (1)
24/// Gets the value that identifies 'Role' claims. This is used when calling <see cref="ClaimsPrincipal.IsInRole"/>.
AuthorizeViewCore.cs (1)
119private async Task<bool> IsAuthorizedAsync(ClaimsPrincipal user)
Microsoft.AspNetCore.Components.Endpoints (1)
CacheView\CacheViewKeyResolver.cs (1)
189private static void AppendUserIdentity(IncrementalHash hash, ClaimsPrincipal user)
Microsoft.AspNetCore.Components.Server (12)
Circuits\CircuitFactory.cs (1)
46ClaimsPrincipal user,
Circuits\CircuitHost.cs (1)
630public void SetCircuitUser(ClaimsPrincipal user)
Circuits\ICircuitFactory.cs (1)
15ClaimsPrincipal user,
Circuits\RevalidatingServerAuthenticationStateProvider.cs (1)
105var anonymousUser = new ClaimsPrincipal(new ClaimsIdentity());
src\aspnetcore\src\Shared\SecurityHelper\SecurityHelper.cs (8)
21/// <param name="existingPrincipal">The <see cref="ClaimsPrincipal"/> containing existing <see cref="ClaimsIdentity"/>.</param> 22/// <param name="additionalPrincipal">The <see cref="ClaimsPrincipal"/> containing <see cref="ClaimsIdentity"/> to be added.</param> 23public static ClaimsPrincipal MergeUserPrincipal(ClaimsPrincipal? existingPrincipal, ClaimsPrincipal? additionalPrincipal) 31var newPrincipal = new ClaimsPrincipal(); 53/// <param name="user">The <see cref="ClaimsPrincipal"/> to inspect.</param> 55public static bool IsAuthenticated(ClaimsPrincipal? user)
Microsoft.AspNetCore.Components.WebAssembly.Authentication (16)
Models\RemoteUserAccount.cs (1)
12/// The information in this type will be used to produce a <see cref="System.Security.Claims.ClaimsPrincipal"/> for the application.
Options\RemoteAuthenticationUserOptions.cs (1)
7/// Represents options to use when configuring the <see cref="System.Security.Claims.ClaimsPrincipal"/> for a user.
Services\AccountClaimsPrincipalFactory.cs (6)
11/// Converts <see cref="RemoteUserAccount" /> into a <see cref="ClaimsPrincipal"/>. 30/// Converts the <paramref name="account"/> into the final <see cref="ClaimsPrincipal"/>. 33/// <param name="options">The <see cref="RemoteAuthenticationUserOptions"/> to configure the <see cref="ClaimsPrincipal"/> with.</param> 34/// <returns>A <see cref="ValueTask{TResult}"/>that will contain the <see cref="ClaimsPrincipal"/> user when completed.</returns> 35public virtual ValueTask<ClaimsPrincipal> CreateUserAsync( 58return new ValueTask<ClaimsPrincipal>(new ClaimsPrincipal(identity));
Services\RemoteAuthenticationService.cs (8)
38private ClaimsPrincipal _cachedUser = new ClaimsPrincipal(new ClaimsIdentity()); 51/// Gets the <see cref="AccountClaimsPrincipalFactory{TAccount}"/> to map accounts to <see cref="ClaimsPrincipal"/>. 66/// <param name="accountClaimsPrincipalFactory">The <see cref="AccountClaimsPrincipalFactory{TAccount}"/> used to generate the <see cref="ClaimsPrincipal"/> for the user.</param> 181private async Task<ClaimsPrincipal> GetUser(bool useCache = false) 199protected internal virtual async ValueTask<ClaimsPrincipal> GetAuthenticatedUser() 203var user = await AccountClaimsPrincipalFactory.CreateUserAsync(account, Options.UserOptions); 227private void UpdateUser(Task<ClaimsPrincipal> task) 231static async Task<AuthenticationState> UpdateAuthenticationState(Task<ClaimsPrincipal> futureUser) => new AuthenticationState(await futureUser);
Microsoft.AspNetCore.Connections.Abstractions (2)
DefaultConnectionContext.cs (1)
78public ClaimsPrincipal? User { get; set; }
Features\IConnectionUserFeature.cs (1)
16ClaimsPrincipal? User { get; set; }
Microsoft.AspNetCore.Http (3)
DefaultHttpContext.cs (2)
154public override ClaimsPrincipal User 158var user = HttpAuthenticationFeature.User;
Features\Authentication\HttpAuthenticationFeature.cs (1)
14public ClaimsPrincipal? User { get; set; }
Microsoft.AspNetCore.Http.Abstractions (6)
Features\AuthenticationRefreshContext.cs (4)
25/// Gets the <see cref="ClaimsPrincipal"/> currently associated with the connection. 27public required ClaimsPrincipal PreviousUser { get; init; } 30/// Gets the <see cref="ClaimsPrincipal"/> produced by re-authenticating the refresh request. 32public required ClaimsPrincipal NewUser { get; init; }
HttpContext.cs (2)
47public abstract ClaimsPrincipal User { get; set; } 96public ClaimsPrincipal User => _context.User;
Microsoft.AspNetCore.Http.Connections (34)
HttpConnectionDispatcherOptions.cs (1)
136/// the connection's <see cref="System.Security.Claims.ClaimsPrincipal"/>.
Internal\HttpConnectionContext.cs (16)
180public ClaimsPrincipal? User { get; set; } 323ClaimsPrincipal user, 329ClaimsPrincipal? previousUserReference; 330ClaimsPrincipal previousUserSnapshot; 378ClaimsPrincipal? previouslyOwnedUser = null; 450ClaimsPrincipal? previousUser, 464ClaimsPrincipal? previousUser, 483internal bool IsUserAssociatedWithConnection(ClaimsPrincipal user) 494private static bool IsUserRefreshAcceptedByDefault(ClaimsPrincipal? currentUser, ClaimsPrincipal user) 517internal static (string Type, string Value, string Issuer)? GetUserIdentityKey(ClaimsPrincipal user) 531internal static bool ClaimsPrincipalContentEquals(ClaimsPrincipal current, ClaimsPrincipal incoming) 583private static bool HasAuthenticatedIdentity(ClaimsPrincipal user) 631ClaimsPrincipal? ownedUser = null; 656private static void DisposeOwnedIdentities(ClaimsPrincipal user)
Internal\HttpConnectionDispatcher.cs (9)
183var newPrincipal = authResult?.Principal ?? context.User; 782var currentUser = connection.User; 787var newPrincipal = context.User; 934private static DateTimeOffset GetAuthenticationExpiration(AuthenticateResult authenticateResult, ClaimsPrincipal fallbackPrincipal, HttpConnectionDispatcherOptions options) 962private static bool HasWindowsIdentity(ClaimsPrincipal? user) 1080private async Task WriteUserChangedResponseAsync(ClaimsPrincipal? originalUser, ClaimsPrincipal newUser, HttpContext context) 1088private void LogUserChanged(ClaimsPrincipal? originalUser, ClaimsPrincipal newUser)
src\aspnetcore\src\Shared\SecurityHelper\SecurityHelper.cs (8)
21/// <param name="existingPrincipal">The <see cref="ClaimsPrincipal"/> containing existing <see cref="ClaimsIdentity"/>.</param> 22/// <param name="additionalPrincipal">The <see cref="ClaimsPrincipal"/> containing <see cref="ClaimsIdentity"/> to be added.</param> 23public static ClaimsPrincipal MergeUserPrincipal(ClaimsPrincipal? existingPrincipal, ClaimsPrincipal? additionalPrincipal) 31var newPrincipal = new ClaimsPrincipal(); 53/// <param name="user">The <see cref="ClaimsPrincipal"/> to inspect.</param> 55public static bool IsAuthenticated(ClaimsPrincipal? user)
Microsoft.AspNetCore.Http.Extensions (1)
RequestDelegateFactory.cs (1)
847else if (parameter.ParameterType == typeof(ClaimsPrincipal))
Microsoft.AspNetCore.Http.Features (2)
Authentication\IHttpAuthenticationFeature.cs (2)
14/// Gets or sets the <see cref="ClaimsPrincipal"/> associated with the HTTP request. 16ClaimsPrincipal? User { get; set; }
Microsoft.AspNetCore.Http.Results (14)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LoggerMessage.g.cs (3)
105private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, string?, global::System.Security.Claims.ClaimsPrincipal, global::System.Exception?> __SignInResultExecutingCallback = 106global::Microsoft.Extensions.Logging.LoggerMessage.Define<string?, global::System.Security.Claims.ClaimsPrincipal>(global::Microsoft.Extensions.Logging.LogLevel.Information, new global::Microsoft.Extensions.Logging.EventId(1, "SignInResultExecuting"), "Executing SignInResult with authentication scheme ({Scheme}) and the following principal: {Principal}.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 113public static partial void SignInResultExecuting(global::Microsoft.Extensions.Logging.ILogger logger, string? scheme, global::System.Security.Claims.ClaimsPrincipal principal)
Results.cs (3)
63/// Creates an <see cref="IResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.SignInAsync(HttpContext, string?, ClaimsPrincipal, AuthenticationProperties?)" />. 65/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param> 70ClaimsPrincipal principal,
SignInHttpResult.cs (5)
21internal SignInHttpResult(ClaimsPrincipal principal) 33internal SignInHttpResult(ClaimsPrincipal principal, string? authenticationScheme, AuthenticationProperties? properties) 46/// Gets or sets the <see cref="ClaimsPrincipal"/> containing the user claims. 48public ClaimsPrincipal Principal { get; internal init; } 74public static partial void SignInResultExecuting(ILogger logger, string? scheme, ClaimsPrincipal principal);
TypedResults.cs (3)
63/// Creates a <see cref="SignInHttpResult"/> that on execution invokes <see cref="AuthenticationHttpContextExtensions.SignInAsync(HttpContext, string?, ClaimsPrincipal, AuthenticationProperties?)" />. 65/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param> 70ClaimsPrincipal principal,
Microsoft.AspNetCore.Identity (85)
ExternalLoginInfo.cs (5)
17/// <param name="principal">The <see cref="ClaimsPrincipal"/> to associate with this login.</param> 21public ExternalLoginInfo(ClaimsPrincipal principal, string loginProvider, string providerKey, 28/// Gets or sets the <see cref="ClaimsPrincipal"/> associated with this login. 30/// <value>The <see cref="ClaimsPrincipal"/> associated with this login.</value> 31public ClaimsPrincipal Principal { get; set; }
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\GeneratedRouteBuilderExtensions.g.cs (48)
1306var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.ContentHttpResult, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.IServiceProvider arg1) => throw null!); 1323var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::System.IServiceProvider>(1)!); 1334var claimsPrincipal_local = httpContext.User; 1355var claimsPrincipal_local = httpContext.User; 1363var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::System.Security.Claims.ClaimsPrincipal, global::System.IServiceProvider>(httpContext, claimsPrincipal_local, sp_local)); 1374var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.ContentHttpResult, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.IServiceProvider arg1) => throw null!); 1410var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.PasskeyInfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::Microsoft.AspNetCore.Identity.Data.PasskeyRegistrationRequest arg1, global::System.IServiceProvider arg2) => throw null!); 1428var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.PasskeyRegistrationRequest>(1)!, ic.GetArgument<global::System.IServiceProvider>(2)!); 1439var claimsPrincipal_local = httpContext.User; 1467var claimsPrincipal_local = httpContext.User; 1482var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::System.Security.Claims.ClaimsPrincipal, global::Microsoft.AspNetCore.Identity.Data.PasskeyRegistrationRequest, global::System.IServiceProvider>(httpContext, claimsPrincipal_local, registration_local!, sp_local)); 1493var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.PasskeyInfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::Microsoft.AspNetCore.Identity.Data.PasskeyRegistrationRequest arg1, global::System.IServiceProvider arg2) => throw null!); 1527var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.PasskeyInfoResponse[]>, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.IServiceProvider arg1) => throw null!); 1544var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::System.IServiceProvider>(1)!); 1555var claimsPrincipal_local = httpContext.User; 1576var claimsPrincipal_local = httpContext.User; 1584var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::System.Security.Claims.ClaimsPrincipal, global::System.IServiceProvider>(httpContext, claimsPrincipal_local, sp_local)); 1595var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.PasskeyInfoResponse[]>, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.IServiceProvider arg1) => throw null!); 1632var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.PasskeyInfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.String arg1, global::Microsoft.AspNetCore.Identity.Data.PasskeyUpdateRequest arg2, global::System.IServiceProvider arg3) => throw null!); 1651var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::System.String>(1)!, ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.PasskeyUpdateRequest>(2)!, ic.GetArgument<global::System.IServiceProvider>(3)!); 1662var claimsPrincipal_local = httpContext.User; 1699var claimsPrincipal_local = httpContext.User; 1723var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::System.Security.Claims.ClaimsPrincipal, global::System.String, global::Microsoft.AspNetCore.Identity.Data.PasskeyUpdateRequest, global::System.IServiceProvider>(httpContext, claimsPrincipal_local, credentialId_local!, request_local!, sp_local)); 1734var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.PasskeyInfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.String arg1, global::Microsoft.AspNetCore.Identity.Data.PasskeyUpdateRequest arg2, global::System.IServiceProvider arg3) => throw null!); 1769var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.String arg1, global::System.IServiceProvider arg2) => throw null!); 1787var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::System.String>(1)!, ic.GetArgument<global::System.IServiceProvider>(2)!); 1798var claimsPrincipal_local = httpContext.User; 1828var claimsPrincipal_local = httpContext.User; 1845var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::System.Security.Claims.ClaimsPrincipal, global::System.String, global::System.IServiceProvider>(httpContext, claimsPrincipal_local, credentialId_local!, sp_local)); 1856var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.String arg1, global::System.IServiceProvider arg2) => throw null!); 1892var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.TwoFactorResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest arg1, global::System.IServiceProvider arg2) => throw null!); 1910var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest>(1)!, ic.GetArgument<global::System.IServiceProvider>(2)!); 1921var claimsPrincipal_local = httpContext.User; 1949var claimsPrincipal_local = httpContext.User; 1964var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::System.Security.Claims.ClaimsPrincipal, global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest, global::System.IServiceProvider>(httpContext, claimsPrincipal_local, tfaRequest_local!, sp_local)); 1975var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.TwoFactorResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest arg1, global::System.IServiceProvider arg2) => throw null!); 2009var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.InfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.IServiceProvider arg1) => throw null!); 2026var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::System.IServiceProvider>(1)!); 2037var claimsPrincipal_local = httpContext.User; 2058var claimsPrincipal_local = httpContext.User; 2066var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::System.Security.Claims.ClaimsPrincipal, global::System.IServiceProvider>(httpContext, claimsPrincipal_local, sp_local)); 2077var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.InfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::System.IServiceProvider arg1) => throw null!); 2114var handler = Cast(del, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.InfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::Microsoft.AspNetCore.Identity.Data.InfoRequest arg1, global::Microsoft.AspNetCore.Http.HttpContext arg2, global::System.IServiceProvider arg3) => throw null!); 2132var task = handler(ic.GetArgument<global::System.Security.Claims.ClaimsPrincipal>(0)!, ic.GetArgument<global::Microsoft.AspNetCore.Identity.Data.InfoRequest>(1)!, ic.GetArgument<global::Microsoft.AspNetCore.Http.HttpContext>(2)!, ic.GetArgument<global::System.IServiceProvider>(3)!); 2143var claimsPrincipal_local = httpContext.User; 2172var claimsPrincipal_local = httpContext.User; 2188var result = await filteredInvocation(EndpointFilterInvocationContext.Create<global::System.Security.Claims.ClaimsPrincipal, global::Microsoft.AspNetCore.Identity.Data.InfoRequest, global::Microsoft.AspNetCore.Http.HttpContext, global::System.IServiceProvider>(httpContext, claimsPrincipal_local, infoRequest_local!, context_local, sp_local)); 2199var castHandler = Cast(handler, global::System.Threading.Tasks.Task<global::Microsoft.AspNetCore.Http.HttpResults.Results<global::Microsoft.AspNetCore.Http.HttpResults.Ok<global::Microsoft.AspNetCore.Identity.Data.InfoResponse>, global::Microsoft.AspNetCore.Http.HttpResults.ValidationProblem, global::Microsoft.AspNetCore.Http.HttpResults.NotFound>> (global::System.Security.Claims.ClaimsPrincipal arg0, global::Microsoft.AspNetCore.Identity.Data.InfoRequest arg1, global::Microsoft.AspNetCore.Http.HttpContext arg2, global::System.IServiceProvider arg3) => throw null!);
IdentityApiEndpointRouteBuilderExtensions.cs (9)
195var newPrincipal = await signInManager.CreateUserPrincipalAsync(user); 331(ClaimsPrincipal claimsPrincipal, [FromServices] IServiceProvider sp) => 356(ClaimsPrincipal claimsPrincipal, [FromBody] PasskeyRegistrationRequest registration, [FromServices] IServiceProvider sp) => 411(ClaimsPrincipal claimsPrincipal, [FromServices] IServiceProvider sp) => 433(ClaimsPrincipal claimsPrincipal, string credentialId, [FromBody] PasskeyUpdateRequest request, [FromServices] IServiceProvider sp) => 472(ClaimsPrincipal claimsPrincipal, string credentialId, [FromServices] IServiceProvider sp) => 503(ClaimsPrincipal claimsPrincipal, [FromBody] TwoFactorRequest tfaRequest, [FromServices] IServiceProvider sp) => 579(ClaimsPrincipal claimsPrincipal, [FromServices] IServiceProvider sp) => 591(ClaimsPrincipal claimsPrincipal, [FromBody] InfoRequest infoRequest, HttpContext context, [FromServices] IServiceProvider sp) =>
IdentityServiceCollectionExtensions.cs (1)
224protected override Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties? properties)
ISecurityStampValidator.cs (1)
19/// <param name="context">The context containing the <see cref="System.Security.Claims.ClaimsPrincipal"/>
SecurityStampRefreshingPrincipalContext.cs (2)
16public ClaimsPrincipal? CurrentPrincipal { get; set; } 21public ClaimsPrincipal? NewPrincipal { get; set; }
SecurityStampValidator.cs (5)
94var newPrincipal = await SignInManager.CreateUserPrincipalAsync(user); 126protected virtual Task<TUser?> VerifySecurityStamp(ClaimsPrincipal? principal) 133/// <param name="context">The context containing the <see cref="System.Security.Claims.ClaimsPrincipal"/> 180/// <param name="context">The context containing the <see cref="System.Security.Claims.ClaimsPrincipal"/> 191/// <param name="context">The context containing the <see cref="System.Security.Claims.ClaimsPrincipal"/>
SignInManager.cs (13)
129/// Creates a <see cref="ClaimsPrincipal"/> for the specified <paramref name="user"/>, as an asynchronous operation. 131/// <param name="user">The user to create a <see cref="ClaimsPrincipal"/> for.</param> 133public virtual async Task<ClaimsPrincipal> CreateUserPrincipalAsync(TUser user) => await ClaimsFactory.CreateAsync(user); 138/// <param name="principal">The <see cref="ClaimsPrincipal"/> instance.</param> 140public virtual bool IsSignedIn(ClaimsPrincipal principal) 290var userPrincipal = await CreateUserPrincipalAsync(user); 347public virtual async Task<TUser?> ValidateSecurityStampAsync(ClaimsPrincipal? principal) 370public virtual async Task<TUser?> ValidateTwoFactorSecurityStampAsync(ClaimsPrincipal? principal) 930var claimsPrincipal = new ClaimsPrincipal(claimsIdentity); 993var principal = await StoreRememberClient(user); 1401/// <returns>A <see cref="ClaimsPrincipal"/> containing the user 2fa information.</returns> 1402internal async Task<ClaimsPrincipal> StoreTwoFactorInfo(TUser user, string? loginProvider) 1419internal async Task<ClaimsPrincipal> StoreRememberClient(TUser user)
TwoFactorSecurityStampValidator.cs (1)
43protected override Task<TUser?> VerifySecurityStamp(ClaimsPrincipal? principal)
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
EndpointMetadataApiDescriptionProvider.cs (1)
282parameterType == typeof(ClaimsPrincipal) ||
Microsoft.AspNetCore.Mvc.Core (28)
ControllerBase.cs (10)
204/// Gets the <see cref="ClaimsPrincipal"/> for user associated with the executing action. 206public ClaimsPrincipal User => HttpContext?.User!; 2441/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param> 2444public virtual SignInResult SignIn(ClaimsPrincipal principal) 2450/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param> 2454public virtual SignInResult SignIn(ClaimsPrincipal principal, string authenticationScheme) 2460/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param> 2465ClaimsPrincipal principal, 2473/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param> 2479ClaimsPrincipal principal,
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LoggerMessage.g.cs (3)
2294private static readonly global::System.Action<global::Microsoft.Extensions.Logging.ILogger, string?, global::System.Security.Claims.ClaimsPrincipal, global::System.Exception?> __SignInResultExecutingCallback = 2295global::Microsoft.Extensions.Logging.LoggerMessage.Define<string?, global::System.Security.Claims.ClaimsPrincipal>(global::Microsoft.Extensions.Logging.LogLevel.Information, new global::Microsoft.Extensions.Logging.EventId(1, "SignInResultExecuting"), "Executing SignInResult with authentication scheme ({Scheme}) and the following principal: {Principal}.", new global::Microsoft.Extensions.Logging.LogDefineOptions() { SkipEnabledCheck = true }); 2302public static partial void SignInResultExecuting(global::Microsoft.Extensions.Logging.ILogger logger, string? scheme, global::System.Security.Claims.ClaimsPrincipal principal)
SignInResult.cs (7)
21public SignInResult(ClaimsPrincipal principal) 32public SignInResult(string? authenticationScheme, ClaimsPrincipal principal) 43public SignInResult(ClaimsPrincipal principal, AuthenticationProperties? properties) 55public SignInResult(string? authenticationScheme, ClaimsPrincipal principal, AuthenticationProperties? properties) 68/// Gets or sets the <see cref="ClaimsPrincipal"/> containing the user claims. 70public ClaimsPrincipal Principal { get; set; } 93public static partial void SignInResultExecuting(ILogger logger, string? scheme, ClaimsPrincipal principal);
src\aspnetcore\src\Shared\SecurityHelper\SecurityHelper.cs (8)
21/// <param name="existingPrincipal">The <see cref="ClaimsPrincipal"/> containing existing <see cref="ClaimsIdentity"/>.</param> 22/// <param name="additionalPrincipal">The <see cref="ClaimsPrincipal"/> containing <see cref="ClaimsIdentity"/> to be added.</param> 23public static ClaimsPrincipal MergeUserPrincipal(ClaimsPrincipal? existingPrincipal, ClaimsPrincipal? additionalPrincipal) 31var newPrincipal = new ClaimsPrincipal(); 53/// <param name="user">The <see cref="ClaimsPrincipal"/> to inspect.</param> 55public static bool IsAuthenticated(ClaimsPrincipal? user)
Microsoft.AspNetCore.Mvc.Razor (2)
RazorPageBase.cs (2)
132/// Gets the <see cref="ClaimsPrincipal"/> of the current logged in user. 134public virtual ClaimsPrincipal User => ViewContext.HttpContext.User;
Microsoft.AspNetCore.Mvc.RazorPages (10)
PageBase.cs (4)
1103/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param> 1106public virtual SignInResult SignIn(ClaimsPrincipal principal, string authenticationScheme) 1113/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param> 1118ClaimsPrincipal principal,
PageModel.cs (6)
84/// Gets the <see cref="ClaimsPrincipal"/> for user associated with the executing action. 86public ClaimsPrincipal User => HttpContext?.User!; 1455/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param> 1458public virtual SignInResult SignIn(ClaimsPrincipal principal, string authenticationScheme) 1465/// <param name="principal">The <see cref="ClaimsPrincipal"/> containing the user claims.</param> 1470ClaimsPrincipal principal,
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
ViewComponent.cs (2)
47/// Gets the <see cref="ClaimsPrincipal"/> for the current user. 49public ClaimsPrincipal UserClaimsPrincipal => ViewContext?.HttpContext?.User!;
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiGenerator.cs (1)
433parameter.ParameterType == typeof(ClaimsPrincipal) ||
Microsoft.AspNetCore.OutputCaching (8)
src\aspnetcore\src\Shared\SecurityHelper\SecurityHelper.cs (8)
21/// <param name="existingPrincipal">The <see cref="ClaimsPrincipal"/> containing existing <see cref="ClaimsIdentity"/>.</param> 22/// <param name="additionalPrincipal">The <see cref="ClaimsPrincipal"/> containing <see cref="ClaimsIdentity"/> to be added.</param> 23public static ClaimsPrincipal MergeUserPrincipal(ClaimsPrincipal? existingPrincipal, ClaimsPrincipal? additionalPrincipal) 31var newPrincipal = new ClaimsPrincipal(); 53/// <param name="user">The <see cref="ClaimsPrincipal"/> to inspect.</param> 55public static bool IsAuthenticated(ClaimsPrincipal? user)
Microsoft.AspNetCore.Owin (6)
OwinEnvironment.cs (1)
417{ OwinConstants.RequestUser, new FeatureMap<IHttpAuthenticationFeature>(feature => feature.User, () => null, (feature, value) => feature.User = (ClaimsPrincipal)value) },
OwinFeatureCollection.cs (2)
283ClaimsPrincipal IHttpAuthenticationFeature.User 287return Prop<ClaimsPrincipal>(OwinConstants.RequestUser)
Utilities.cs (3)
33internal static ClaimsPrincipal MakeClaimsPrincipal(IPrincipal principal) 39if (principal is ClaimsPrincipal) 41return principal as ClaimsPrincipal;
Microsoft.AspNetCore.Routing (1)
ValidationEndpointFilterFactory.cs (1)
139parameterType == typeof(ClaimsPrincipal) ||
Microsoft.AspNetCore.Server.HttpSys (2)
RequestProcessing\RequestContext.FeatureCollection.cs (2)
66private ClaimsPrincipal? _user; 592ClaimsPrincipal? IHttpAuthenticationFeature.User
Microsoft.AspNetCore.Server.IIS (2)
Core\IISHttpContext.cs (1)
115public ClaimsPrincipal? User { get; set; }
Core\IISHttpContext.FeatureCollection.cs (1)
282ClaimsPrincipal? IHttpAuthenticationFeature.User
Microsoft.AspNetCore.SignalR.Core (21)
Hub.cs (1)
91/// SignalR authentication-refresh endpoint. The new <see cref="System.Security.Claims.ClaimsPrincipal"/> is
HubCallerContext.cs (1)
31public abstract ClaimsPrincipal? User { get; }
HubConnectionContext.cs (7)
146public virtual ClaimsPrincipal User 207internal string? GetUserIdentifier(ClaimsPrincipal user, IUserIdProvider userIdProvider) 221internal void ApplyUserState(ClaimsPrincipal user, string? userIdentifier) 227internal void ApplyUser(ClaimsPrincipal user) 234public UserIdProviderUserState(HubConnectionContext connection, ClaimsPrincipal user) 242public ClaimsPrincipal User { get; } 708var user = Features.Get<IConnectionUserFeature>()?.User ?? new ClaimsPrincipal();
HubConnectionHandler.cs (8)
224private static bool IsSameUserByDefault(ClaimsPrincipal currentUser, ClaimsPrincipal newUser) 246private static (string Type, string Value, string Issuer)? GetUserIdentityKey(ClaimsPrincipal user) 260private static bool ClaimsPrincipalContentEquals(ClaimsPrincipal current, ClaimsPrincipal incoming) 312private static bool HasAuthenticatedIdentity(ClaimsPrincipal user) 315private void OnAuthenticationRefreshed(HubConnectionContext connection, ClaimsPrincipal user, SemaphoreSlim authenticationRefreshLock) 321private async Task HandleUserRefreshedAsync(HubConnectionContext connection, ClaimsPrincipal user, SemaphoreSlim authenticationRefreshLock)
Internal\DefaultHubCallerContext.cs (3)
15private readonly ClaimsPrincipal _user; 17public DefaultHubCallerContext(HubConnectionContext connection, ClaimsPrincipal user) 30public override ClaimsPrincipal? User => _user;
Internal\DefaultHubDispatcher.cs (1)
778private static async Task<bool> IsHubMethodAuthorizedSlow(IServiceProvider provider, ClaimsPrincipal principal, HubMethodDescriptor descriptor, HubInvocationContext resource)
Microsoft.Extensions.Identity.Core (17)
IUserClaimsPrincipalFactory.cs (5)
10/// Provides an abstraction for a factory to create a <see cref="ClaimsPrincipal"/> from a user. 17/// Creates a <see cref="ClaimsPrincipal"/> from an user asynchronously. 19/// <param name="user">The user to create a <see cref="ClaimsPrincipal"/> from.</param> 20/// <returns>The <see cref="Task"/> that represents the asynchronous creation operation, containing the created <see cref="ClaimsPrincipal"/>.</returns> 21Task<ClaimsPrincipal> CreateAsync(TUser user);
PrincipalExtensions.cs (3)
9/// Claims related extensions for <see cref="ClaimsPrincipal"/>. 16/// <param name="principal">The <see cref="ClaimsPrincipal"/> instance this method extends.</param> 19public static string? FindFirstValue(this ClaimsPrincipal principal, string claimType)
UserClaimsPrincipalFactory.cs (4)
55/// Creates a <see cref="ClaimsPrincipal"/> from an user asynchronously. 57/// <param name="user">The user to create a <see cref="ClaimsPrincipal"/> from.</param> 58/// <returns>The <see cref="Task"/> that represents the asynchronous creation operation, containing the created <see cref="ClaimsPrincipal"/>.</returns> 59public virtual async Task<ClaimsPrincipal> CreateAsync(TUser user)
UserManager.cs (5)
428/// <param name="principal">The <see cref="ClaimsPrincipal"/> instance.</param> 431public virtual string? GetUserName(ClaimsPrincipal principal) 440/// <param name="principal">The <see cref="ClaimsPrincipal"/> instance.</param> 443public virtual string? GetUserId(ClaimsPrincipal principal) 456public virtual Task<TUser?> GetUserAsync(ClaimsPrincipal principal)
mscorlib (1)
parent\ref\mscorlib.cs (1)
853[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Claims.ClaimsPrincipal))]
netstandard (1)
netstandard.cs (1)
1837[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Claims.ClaimsPrincipal))]
System.Security.Claims (20)
System\Security\Claims\ClaimsIdentity.cs (4)
118/// <param name="roleType">The <see cref="Claim.Type"/> used when performing logic for <see cref="ClaimsPrincipal.IsInRole"/>.</param> 131/// <param name="roleType">The <see cref="Claim.Type"/> used when performing logic for <see cref="ClaimsPrincipal.IsInRole"/>.</param> 145/// <param name="roleType">The <see cref="Claim.Type"/> used when performing logic for <see cref="ClaimsPrincipal.IsInRole"/>.</param> 446/// Gets the value that identifies 'Role' claims. This is used when calling <see cref="ClaimsPrincipal.IsInRole"/>.
System\Security\Claims\ClaimsPrincipal.cs (16)
31private static Func<ClaimsPrincipal?>? s_principalSelector; 33private static ClaimsPrincipal? SelectClaimsPrincipal() 44ClaimsPrincipal claimsPrincipal => claimsPrincipal, 81public static Func<ClaimsPrincipal?>? ClaimsPrincipalSelector 88/// Initializes an instance of <see cref="ClaimsPrincipal"/>. 95/// Initializes an instance of <see cref="ClaimsPrincipal"/>. 107/// Initializes an instance of <see cref="ClaimsPrincipal"/> 126/// Initializes an instance of <see cref="ClaimsPrincipal"/> 138ClaimsPrincipal? cp = principal as ClaimsPrincipal; 153/// Initializes an instance of <see cref="ClaimsPrincipal"/> using a <see cref="BinaryReader"/>. 156/// <param name="reader">a <see cref="BinaryReader"/> pointing to a <see cref="ClaimsPrincipal"/>.</param> 214/// Gets the claims as <see cref="IEnumerable{Claim}"/>, associated with this <see cref="ClaimsPrincipal"/> by enumerating all <see cref="Identities"/>. 242/// Creates a new instance of <see cref="ClaimsPrincipal"/> with values copied from this object. 244public virtual ClaimsPrincipal Clone() 265public static ClaimsPrincipal? Current
System.ServiceModel.Primitives (1)
System\ServiceModel\OperationContext.cs (1)
311public ClaimsPrincipal ClaimsPrincipal