public async Task <ClaimsPrincipal> TransformAsync(ClaimsPrincipal principal)
        {
            if (principal is MyPrincipal myPrincipal)
            {
                return(principal);
            }

            var userName = principal.FindAll(ClaimTypes.Name).Last().Value;
            var userId   = principal.FindAll(ClaimTypes.NameIdentifier).Last().Value;

            var claimsIdentity = new MyIdentity(userId, userName);

            return(new ClaimsPrincipal(claimsIdentity));
        }
 public MyPrincipal(MyIdentity identity)
     : base(identity)
 {
 }