1 override of User
Microsoft.AspNetCore.Http (1)
DefaultHttpContext.cs (1)
154public override ClaimsPrincipal User
14 writes to User
Aspire.Dashboard (2)
Authentication\AspirePolicyEvaluator.cs (2)
67context.User = newPrincipal; 76context.User = new ClaimsPrincipal(new ClaimsIdentity());
Microsoft.AspNetCore.Authentication (1)
AuthenticationMiddleware.cs (1)
65context.User = result.Principal;
Microsoft.AspNetCore.Authorization.Policy (2)
PolicyEvaluator.cs (2)
56context.User = newPrincipal; 65context.User = new ClaimsPrincipal(new ClaimsIdentity());
Microsoft.AspNetCore.Http.Connections (6)
Internal\HttpConnectionContext.cs (1)
317httpContext.User = user;
Internal\HttpConnectionDispatcher.cs (5)
944httpContext.User = currentUser; 990pollContext.User = context.User; 1063newContext.User = new WindowsPrincipal((WindowsIdentity)(windowsIdentity.Clone())); 1068newContext.User = new ClaimsPrincipal(); 1083newContext.User = oldContext.User;
Microsoft.AspNetCore.Identity (1)
SignInManager.cs (1)
293Context.User = userPrincipal;
Microsoft.AspNetCore.Server.IISIntegration (2)
IISMiddleware.cs (2)
155httpContext.User = user; 199context.User = null!;
48 references to User
Aspire.Dashboard (4)
Authentication\AspirePolicyEvaluator.cs (4)
33/// <see cref="ClaimsPrincipal"/> to <see cref="HttpContext.User"/>. If no schemes are set, this is a no-op. 86return (context.User?.Identity?.IsAuthenticated ?? false) 87? AuthenticateResult.Success(new AuthenticationTicket(context.User, "context.User")) 114var result = await _authorization.AuthorizeAsync(context.User, resource, policy).ConfigureAwait(false);
Microsoft.AspNetCore.Antiforgery (4)
Internal\DefaultAntiforgeryTokenGenerator.cs (4)
59var authenticatedIdentity = GetAuthenticatedIdentity(httpContext.User); 65var extractClaimUidBytesResult = _claimUidExtractor.TryExtractClaimUidBytes(httpContext.User, claimUidBytes); 148var authenticatedIdentity = GetAuthenticatedIdentity(httpContext.User); 151extractedClaimUidBytes = _claimUidExtractor.TryExtractClaimUidBytes(httpContext.User, currentClaimUidBytes);
Microsoft.AspNetCore.Authorization.Policy (5)
IPolicyEvaluator.cs (1)
17/// <see cref="ClaimsPrincipal"/> to <see cref="HttpContext.User"/>. If no schemes are set, this is a no-op.
PolicyEvaluator.cs (4)
29/// <see cref="ClaimsPrincipal"/> to <see cref="HttpContext.User"/>. If no schemes are set, this is a no-op. 75return (context.User?.Identity?.IsAuthenticated ?? false) 76? AuthenticateResult.Success(new AuthenticationTicket(context.User, "context.User")) 98var result = await _authorization.AuthorizeAsync(context.User, resource, policy);
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\EndpointHtmlRenderer.cs (1)
97var authenticationState = new AuthenticationState(httpContext.User);
Microsoft.AspNetCore.Http.Abstractions (1)
HttpContext.cs (1)
96public ClaimsPrincipal User => _context.User;
Microsoft.AspNetCore.Http.Connections (15)
Internal\HttpConnectionDispatcher.cs (15)
190var newPrincipal = authResult.Principal ?? context.User; 197var newExpiration = GetAuthenticationExpiration(authResult, context.User); 652var expiresUtc = authenticateResult is not null && !HasWindowsIdentity(authenticateResult.Principal ?? context.User) 883var newPrincipal = (transportType == HttpTransportType.LongPolling ? context.User : connection.HttpContext?.User) 988&& !HasWindowsIdentity(context.User)) 990pollContext.User = context.User; 994connection.User = connection.HttpContext?.User; 1019? GetAuthenticationExpiration(authenticateResult, context.User) 1035? GetAuthenticationExpiration(authenticateResult, context.User) 1056if (oldContext.User.Identity is WindowsIdentity windowsIdentity) 1059if (OperatingSystem.IsWindows() && oldContext.User is WindowsPrincipal) 1071foreach (var identity in oldContext.User.Identities) 1078newContext.User.AddIdentity(identity.Clone()); 1083newContext.User = oldContext.User;
Microsoft.AspNetCore.Http.Extensions (1)
RequestDelegateFactory.cs (1)
96private static readonly MemberExpression UserExpr = Expression.Property(HttpContextExpr, typeof(HttpContext).GetProperty(nameof(HttpContext.User))!);
Microsoft.AspNetCore.HttpLogging (1)
W3CLoggingMiddleware.cs (1)
209shouldLog |= AddToList(elements, _userNameIndex, context.User?.Identity?.Name ?? "");
Microsoft.AspNetCore.Identity (6)
_generated\0\GeneratedRouteBuilderExtensions.g.cs (6)
1034var claimsPrincipal_local = httpContext.User; 1062var claimsPrincipal_local = httpContext.User; 1150var claimsPrincipal_local = httpContext.User; 1171var claimsPrincipal_local = httpContext.User; 1256var claimsPrincipal_local = httpContext.User; 1285var claimsPrincipal_local = httpContext.User;
Microsoft.AspNetCore.Mvc.Core (1)
ControllerBase.cs (1)
206public ClaimsPrincipal User => HttpContext?.User!;
Microsoft.AspNetCore.Mvc.Razor (1)
RazorPageBase.cs (1)
134public virtual ClaimsPrincipal User => ViewContext.HttpContext.User;
Microsoft.AspNetCore.Mvc.RazorPages (1)
PageModel.cs (1)
86public ClaimsPrincipal User => HttpContext?.User!;
Microsoft.AspNetCore.Mvc.TagHelpers (2)
Cache\CacheTagKey.cs (1)
100_username = httpContext.User?.Identity?.Name;
CacheTagHelperBase.cs (1)
92/// <see cref="Http.HttpContext.User"/>.
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
ViewComponent.cs (2)
44public IPrincipal User => ViewContext?.HttpContext?.User!; 49public ClaimsPrincipal UserClaimsPrincipal => ViewContext?.HttpContext?.User!;
Microsoft.AspNetCore.OutputCaching (2)
Policies\DefaultPolicy.cs (2)
53if (context.HttpContext.User?.Identity?.IsAuthenticated == true) 82if (!StringValues.IsNullOrEmpty(request.Headers.Authorization) || request.HttpContext.User?.Identity?.IsAuthenticated == true)
Microsoft.AspNetCore.Server.IISIntegration (1)
IISMiddleware.cs (1)
197if (context.User is WindowsPrincipal)