@page "/" @using System.Security.Claims @inject AuthenticationStateProvider AuthenticationStateProvider Index

Hello, world!

Welcome to your new app. @if (_claims.Count() > 0) { } @code { protected override async Task OnInitializedAsync() { await GetClaimsPrincipalData(); await base.OnInitializedAsync(); } private IEnumerable _claims = Enumerable.Empty(); private async Task GetClaimsPrincipalData() { var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); var user = authState.User; if (user.Identity.IsAuthenticated) { _claims = user.Claims; } } }