1 write to User
Microsoft.AspNetCore.Authorization (1)
AuthorizationHandlerContext.cs (1)
36
User
= user;
15 references to User
BasicTestApp (1)
Program.cs (1)
39
policy.RequireAssertion(ctx => ctx.
User
.Identity.Name?.StartsWith('B') ?? false));
BasicWebSite (1)
ManagerHandler.cs (1)
13
if (context.
User
.HasClaim("Manager", "yes"))
CustomPolicyProvider (1)
Authorization\MinimumAgeAuthorizationHandler.cs (1)
32
var dateOfBirthClaim = context.
User
.FindFirst(c => c.Type == ClaimTypes.DateOfBirth);
Microsoft.AspNetCore.Authorization (8)
ClaimsAuthorizationRequirement.cs (3)
53
if (context.
User
!= null)
58
foreach (var claim in context.
User
.Claims)
69
foreach (var claim in context.
User
.Claims)
DenyAnonymousAuthorizationRequirement.cs (1)
24
var user = context.
User
;
NameAuthorizationRequirement.cs (2)
40
if (context.
User
!= null)
44
foreach (var identity in context.
User
.Identities)
RolesAuthorizationRequirement.cs (2)
45
if (context.
User
!= null)
51
if (context.
User
.IsInRole(role))
Microsoft.AspNetCore.Authorization.Test (1)
DefaultAuthorizationServiceTests.cs (1)
831
if (context.
User
.HasClaim("SuperUser", "yes"))
Microsoft.AspNetCore.SignalR.Tests (2)
HubConnectionHandlerTests.cs (1)
2315
Assert.Equal(context.
User
, resource.Context.User);
TestAuthHandler.cs (1)
19
var hasClaim = context.
User
.HasClaim(o => o.Type == ClaimTypes.NameIdentifier && !string.IsNullOrEmpty(o.Value));
StaticFilesAuth (1)
Startup.cs (1)
39
var userName = context.
User
.Identity.Name;