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; }
640900cookie-checkC# Get first claim value from ClaimsIdentity