@using System.Security.Claims
@using Microsoft.AspNetCore.Authentication;
@using OpenIddict.Client.AspNetCore;
@using OpenIddict.Sandbox.AspNetCore.Client.ViewModels.Home;
@using static OpenIddict.Abstractions.OpenIddictConstants;
@model IndexViewModel
@if (User.Identity != null && User.Identity.IsAuthenticated)
{
Welcome, @User.Identity.Name
@foreach (var claim in Context.User.Claims)
{
@claim.Type: @claim.Value
}
if (!string.IsNullOrEmpty(Model.Message))
{
Payload returned by the controller: @Model.Message
}
if (User.FindFirst(Claims.Private.ProviderName)?.Value is "Local")
{
}
if (!string.IsNullOrEmpty(await Context.GetTokenAsync(OpenIddictClientAspNetCoreConstants.Tokens.RefreshToken)))
{
}
}
else
{
Welcome, anonymous
}