C# Get first claim value from ClaimsIdentity

Date: 2022-07-25
protected string UserName => GetClaim("sub");
protected string TokenId => GetClaim("auth_time");
protected string GetClaim(string key)
{
    return CurrentUser?.Claims?.FirstOrDefault(c => c.Type == key)?.Value;
}
64090cookie-checkC# Get first claim value from ClaimsIdentity