public async Task Invoke(HttpContext context)
 {
     var handler = new ClaimsTransformationHandler(Options.Transformer);
     handler.RegisterAuthenticationHandler(context.GetAuthentication());
     try {
         if (Options.Transformer != null)
         {
             context.User = await Options.Transformer.TransformAsync(context.User);
         }
         await _next(context);
     }
     finally
     {
         handler.UnregisterAuthenticationHandler(context.GetAuthentication());
     }
 }
        public async Task Invoke(HttpContext context)
        {
            var handler = new ClaimsTransformationHandler(Options.Transformer);

            handler.RegisterAuthenticationHandler(context.GetAuthentication());
            try {
                if (Options.Transformer != null)
                {
                    context.User = await Options.Transformer.TransformAsync(context.User);
                }
                await _next(context);
            }
            finally
            {
                handler.UnregisterAuthenticationHandler(context.GetAuthentication());
            }
        }