@using System.Security.Claims
@using Microsoft.AspNetCore.Authentication;
@using OpenIddict.Client.AspNetCore;
@using static OpenIddict.Abstractions.OpenIddictConstants;
@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(Claims.Private.ProviderName)?.Value is "Local")
{
}
if (!string.IsNullOrEmpty(await Context.GetTokenAsync(OpenIddictClientAspNetCoreConstants.Tokens.RefreshToken)))
{
}
}
else
{
Welcome, anonymous
}