1 override of User
Microsoft.AspNetCore.Http (1)
DefaultHttpContext.cs (1)
154public override ClaimsPrincipal User
12 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 (4)
Internal\HttpConnectionDispatcher.cs (4)
635existing.User = context.User; 690newContext.User = new WindowsPrincipal((WindowsIdentity)(windowsIdentity.Clone())); 695newContext.User = new ClaimsPrincipal(); 710newContext.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!;
41 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 (9)
Internal\HttpConnectionDispatcher.cs (9)
633if (!(context.User.Identity is WindowsIdentity)) 635existing.User = context.User; 647var newName = connection.HttpContext?.User.FindFirst(ClaimTypes.NameIdentifier)?.Value; 656connection.User = connection.HttpContext?.User; 683if (oldContext.User.Identity is WindowsIdentity windowsIdentity) 686if (OperatingSystem.IsWindows() && oldContext.User is WindowsPrincipal) 698foreach (var identity in oldContext.User.Identities) 705newContext.User.AddIdentity(identity.Clone()); 710newContext.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 (1)
Policies\DefaultPolicy.cs (1)
76if (!StringValues.IsNullOrEmpty(request.Headers.Authorization) || request.HttpContext.User?.Identity?.IsAuthenticated == true)
Microsoft.AspNetCore.Server.IISIntegration (1)
IISMiddleware.cs (1)
197if (context.User is WindowsPrincipal)