@using System.Security.Claims @using Microsoft.AspNetCore.Authentication; @using OpenIddict.Client.AspNetCore; @model string
@if (User?.Identity is { IsAuthenticated: true }) {

Welcome, @User.Identity.Name

@foreach (var claim in Context.User.Claims) {

@claim.Type: @claim.Value
}

if (!string.IsNullOrEmpty(Model)) {

Payload returned by the controller: @Model

} if (User.FindFirst(ClaimTypes.NameIdentifier)?.Issuer is "https://localhost:44395/") {
} if (!string.IsNullOrEmpty(await Context.GetTokenAsync(OpenIddictClientAspNetCoreConstants.Tokens.RefreshToken))) {
}
} else {

Welcome, anonymous

}