Base:
property
User
Microsoft.AspNetCore.Http.HttpContext.User
27 writes to User
Microsoft.AspNetCore.Antiforgery.Test (18)
DefaultAntiforgeryTest.cs (1)
1415httpContext.User = new ClaimsPrincipal(new ClaimsIdentity("some-auth"));
DefaultAntiforgeryTokenGeneratorTest.cs (17)
36httpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 56httpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 85httpContext.User = new ClaimsPrincipal(new MyAuthenticatedIdentityWithoutUsername()); 116httpContext.User = new ClaimsPrincipal(new MyAuthenticatedIdentityWithoutUsername()); 148httpContext.User = new ClaimsPrincipal(identity); 188httpContext.User = new ClaimsPrincipal(mockIdentity.Object); 269httpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 290httpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 311httpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 338httpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 365httpContext.User = new ClaimsPrincipal(new ClaimsIdentity()); 394httpContext.User = new ClaimsPrincipal(identity); 431httpContext.User = new ClaimsPrincipal(identity); 469httpContext.User = new ClaimsPrincipal(identity); 506httpContext.User = new ClaimsPrincipal(identity); 540httpContext.User = new ClaimsPrincipal(identity); 574httpContext.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.Extensions.Tests (1)
RequestDelegateFactoryTests.cs (1)
1247httpContext.User = new ClaimsPrincipal();
Microsoft.AspNetCore.Http.Tests (3)
DefaultHttpContextTests.cs (3)
89context.User = null; 96context.User = new ClaimsPrincipal(); 102context.User = new ClaimsPrincipal(new ClaimsIdentity("SomeAuthType"));
25 references to User
Microsoft.AspNetCore.Antiforgery.Test (2)
DefaultAntiforgeryTokenGeneratorTest.cs (2)
37Assert.False(httpContext.User.Identity.IsAuthenticated); 57Assert.False(httpContext.User.Identity.IsAuthenticated);
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.Extensions.Tests (1)
RequestDelegateFactoryTests.cs (1)
1254Assert.Equal(httpContext.User, userArgument);
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);