Base:
property
User
Microsoft.AspNetCore.Http.HttpContext.User
28 writes to User
Microsoft.AspNetCore.Antiforgery.Microbenchmarks (2)
Benchmarks\AntiforgeryBenchmarks.cs (2)
104context.User = new ClaimsPrincipal(identity); 125context.User = new ClaimsPrincipal(identity);
Microsoft.AspNetCore.Antiforgery.Test (18)
DefaultAntiforgeryTest.cs (1)
1415httpContext.User = new ClaimsPrincipal(new ClaimsIdentity("some-auth"));
DefaultAntiforgeryTokenGeneratorTest.cs (17)
37httpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 57httpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 86httpContext.User = new ClaimsPrincipal(new MyAuthenticatedIdentityWithoutUsername()); 117httpContext.User = new ClaimsPrincipal(new MyAuthenticatedIdentityWithoutUsername()); 149httpContext.User = new ClaimsPrincipal(identity); 184httpContext.User = new ClaimsPrincipal(mockIdentity.Object); 265httpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 286httpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 307httpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 334httpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 361httpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 390httpContext.User = new ClaimsPrincipal(identity); 421httpContext.User = new ClaimsPrincipal(identity); 453httpContext.User = new ClaimsPrincipal(identity); 490httpContext.User = new ClaimsPrincipal(identity); 524httpContext.User = new ClaimsPrincipal(identity); 558httpContext.User = new ClaimsPrincipal(identity);
Microsoft.AspNetCore.Authorization.Test (1)
AuthorizationMiddlewareTests.cs (1)
1055httpContext.User = validUser;
Microsoft.AspNetCore.Http.Connections.Tests (4)
HttpConnectionDispatcherTests.cs (4)
774context.User = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim("claim1", "claimValue") })); 1853context.User = new WindowsPrincipal(windowsIdentity); 1905context.User = new ClaimsPrincipal(windowsIdentity); 1954context.User = new WindowsPrincipal(windowsIdentity);
Microsoft.AspNetCore.Http.Tests (3)
DefaultHttpContextTests.cs (3)
89context.User = null; 96context.User = new ClaimsPrincipal(); 102context.User = new ClaimsPrincipal(new ClaimsIdentity("SomeAuthType"));
27 references to User
Microsoft.AspNetCore.Antiforgery.Test (5)
DefaultAntiforgeryTokenGeneratorTest.cs (5)
38Assert.False(httpContext.User.Identity.IsAuthenticated); 58Assert.False(httpContext.User.Identity.IsAuthenticated); 89var claimUidExtractor = new DummyClaimUidExtractor(httpContext.User.Identity!, blob: null, failsExtraction: true); 123var claimUidExtractor = new DummyClaimUidExtractor(httpContext.User.Identity!, blob: null, failsExtraction: true); 186var claimUidExtractor = new DummyClaimUidExtractor(httpContext.User.Identity!, blob: null, failsExtraction: true);
Microsoft.AspNetCore.Http.Connections.Tests (3)
HttpConnectionDispatcherTests.cs (3)
1854context.User.AddIdentity(new ClaimsIdentity()); 1906context.User.AddIdentity(new ClaimsIdentity()); 1955context.User.AddIdentity(new ClaimsIdentity());
Microsoft.AspNetCore.Http.Tests (19)
DefaultHttpContextTests.cs (19)
83Assert.NotNull(context.User); 84Assert.Single(context.User.Identities); 85Assert.True(object.ReferenceEquals(context.User, context.User)); 86Assert.False(context.User.Identity.IsAuthenticated); 87Assert.True(string.IsNullOrEmpty(context.User.Identity.AuthenticationType)); 90Assert.NotNull(context.User); 91Assert.Single(context.User.Identities); 92Assert.True(object.ReferenceEquals(context.User, context.User)); 93Assert.False(context.User.Identity.IsAuthenticated); 94Assert.True(string.IsNullOrEmpty(context.User.Identity.AuthenticationType)); 97Assert.NotNull(context.User); 98Assert.Empty(context.User.Identities); 99Assert.True(object.ReferenceEquals(context.User, context.User)); 100Assert.Null(context.User.Identity); 103Assert.Equal("SomeAuthType", context.User.Identity.AuthenticationType); 104Assert.True(context.User.Identity.IsAuthenticated);