1 write to User
Microsoft.AspNetCore.Components.Authorization (1)
AuthenticationState.cs (1)
20
User
= user;
26 references to User
Microsoft.AspNetCore.Components.Authorization (2)
AuthenticationStateData.cs (1)
14
/// The client-readable claims that describe the <see cref="AuthenticationState.
User
"/>.
AuthorizeViewCore.cs (1)
91
isAuthorized = await IsAuthorizedAsync(currentAuthenticationState.
User
);
Microsoft.AspNetCore.Components.Authorization.Tests (9)
AuthorizeRouteViewTest.cs (2)
184
state => builder => builder.AddContent(0, $"Go away, {state.
User
.Identity.Name}");
209
state => builder => builder.AddContent(0, $"Go away, {state.
User
.Identity.Name}");
AuthorizeViewTest.cs (6)
58
context => builder => builder.AddContent(0, $"You are not authorized, even though we know you are {context.
User
.Identity.Name}"));
122
builder.AddContent(0, $"You are authenticated as {context.
User
.Identity.Name}"));
158
builder.AddContent(0, $"You are authenticated as {context.
User
.Identity.Name}"));
194
builder.AddContent(0, $"You are authenticated as {context.
User
.Identity.Name}"));
301
authorized: context => builder => builder.AddContent(0, $"Hello, {context.
User
.Identity.Name}!"));
360
authorized: context => builder => builder.AddContent(0, $"Hello, {context.
User
.Identity.Name}!"));
CascadingAuthenticationStateTest.cs (1)
165
var identity = AuthStateTask.Result.
User
.Identity;
Microsoft.AspNetCore.Components.Server (1)
Circuits\RevalidatingServerAuthenticationStateProvider.cs (1)
64
if (authenticationState.
User
.Identity?.IsAuthenticated == true)
Microsoft.AspNetCore.Components.Server.Tests (9)
Circuits\RevalidatingServerAuthenticationStateProviderTest.cs (9)
51
Assert.Equal("test user", (await provider.GetAuthenticationStateAsync()).
User
.Identity.Name);
71
Assert.False(newAuthState.
User
.Identity.IsAuthenticated);
95
Assert.False(newAuthState.
User
.Identity.IsAuthenticated);
112
call => Assert.Equal("test user", call.AuthenticationState.
User
.Identity.Name));
124
call => Assert.Equal("different user", call.AuthenticationState.
User
.Identity.Name));
173
Assert.Equal("different user", (await provider.GetAuthenticationStateAsync()).
User
.Identity.Name);
178
call => Assert.Equal("different user", call.AuthenticationState.
User
.Identity.Name));
212
Assert.False(newAuthState.
User
.Identity.IsAuthenticated);
213
Assert.Null(newAuthState.
User
.Identity.Name);
Microsoft.AspNetCore.Components.WebAssembly.Server (5)
AuthenticationStateSerializationOptions.cs (5)
40
if (authenticationState.
User
.Identity?.IsAuthenticated ?? false)
44
if (authenticationState.
User
.Identities.FirstOrDefault() is { } identity)
52
foreach (var claim in authenticationState.
User
.Claims)
59
if (authenticationState.
User
.FindFirst(data.NameClaimType) is { } nameClaim)
64
foreach (var roleClaim in authenticationState.
User
.FindAll(data.RoleClaimType))