Base:
property
User
Microsoft.AspNetCore.Http.HttpContext.User
27 writes to User
Microsoft.AspNetCore.Antiforgery.Test (18)
DefaultAntiforgeryTest.cs (1)
1415
httpContext.
User
= new ClaimsPrincipal(new ClaimsIdentity("some-auth"));
DefaultAntiforgeryTokenGeneratorTest.cs (17)
36
httpContext.
User
= new ClaimsPrincipal(new ClaimsIdentity());
56
httpContext.
User
= new ClaimsPrincipal(new ClaimsIdentity());
85
httpContext.
User
= new ClaimsPrincipal(new MyAuthenticatedIdentityWithoutUsername());
116
httpContext.
User
= new ClaimsPrincipal(new MyAuthenticatedIdentityWithoutUsername());
148
httpContext.
User
= new ClaimsPrincipal(identity);
188
httpContext.
User
= new ClaimsPrincipal(mockIdentity.Object);
269
httpContext.
User
= new ClaimsPrincipal(new ClaimsIdentity());
290
httpContext.
User
= new ClaimsPrincipal(new ClaimsIdentity());
311
httpContext.
User
= new ClaimsPrincipal(new ClaimsIdentity());
338
httpContext.
User
= new ClaimsPrincipal(new ClaimsIdentity());
365
httpContext.
User
= new ClaimsPrincipal(new ClaimsIdentity());
394
httpContext.
User
= new ClaimsPrincipal(identity);
431
httpContext.
User
= new ClaimsPrincipal(identity);
469
httpContext.
User
= new ClaimsPrincipal(identity);
506
httpContext.
User
= new ClaimsPrincipal(identity);
540
httpContext.
User
= new ClaimsPrincipal(identity);
574
httpContext.
User
= new ClaimsPrincipal(identity);
Microsoft.AspNetCore.Authorization.Test (1)
AuthorizationMiddlewareTests.cs (1)
1055
httpContext.
User
= validUser;
Microsoft.AspNetCore.Http.Connections.Tests (4)
HttpConnectionDispatcherTests.cs (4)
774
context.
User
= new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim("claim1", "claimValue") }));
1853
context.
User
= new WindowsPrincipal(windowsIdentity);
1905
context.
User
= new ClaimsPrincipal(windowsIdentity);
1954
context.
User
= new WindowsPrincipal(windowsIdentity);
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateFactoryTests.cs (1)
1247
httpContext.
User
= new ClaimsPrincipal();
Microsoft.AspNetCore.Http.Tests (3)
DefaultHttpContextTests.cs (3)
89
context.
User
= null;
96
context.
User
= new ClaimsPrincipal();
102
context.
User
= new ClaimsPrincipal(new ClaimsIdentity("SomeAuthType"));
25 references to User
Microsoft.AspNetCore.Antiforgery.Test (2)
DefaultAntiforgeryTokenGeneratorTest.cs (2)
37
Assert.False(httpContext.
User
.Identity.IsAuthenticated);
57
Assert.False(httpContext.
User
.Identity.IsAuthenticated);
Microsoft.AspNetCore.Http.Connections.Tests (3)
HttpConnectionDispatcherTests.cs (3)
1854
context.
User
.AddIdentity(new ClaimsIdentity());
1906
context.
User
.AddIdentity(new ClaimsIdentity());
1955
context.
User
.AddIdentity(new ClaimsIdentity());
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateFactoryTests.cs (1)
1254
Assert.Equal(httpContext.
User
, userArgument);
Microsoft.AspNetCore.Http.Tests (19)
DefaultHttpContextTests.cs (19)
83
Assert.NotNull(context.
User
);
84
Assert.Single(context.
User
.Identities);
85
Assert.True(object.ReferenceEquals(context.
User
, context.
User
));
86
Assert.False(context.
User
.Identity.IsAuthenticated);
87
Assert.True(string.IsNullOrEmpty(context.
User
.Identity.AuthenticationType));
90
Assert.NotNull(context.
User
);
91
Assert.Single(context.
User
.Identities);
92
Assert.True(object.ReferenceEquals(context.
User
, context.
User
));
93
Assert.False(context.
User
.Identity.IsAuthenticated);
94
Assert.True(string.IsNullOrEmpty(context.
User
.Identity.AuthenticationType));
97
Assert.NotNull(context.
User
);
98
Assert.Empty(context.
User
.Identities);
99
Assert.True(object.ReferenceEquals(context.
User
, context.
User
));
100
Assert.Null(context.
User
.Identity);
103
Assert.Equal("SomeAuthType", context.
User
.Identity.AuthenticationType);
104
Assert.True(context.
User
.Identity.IsAuthenticated);