public OpenIdConnectAuthenticationMiddlewareForTestingAuthenticate(
     RequestDelegate next,            
     IDataProtectionProvider dataProtectionProvider,
     ILoggerFactory loggerFactory,
     IUrlEncoder encoder,
     IServiceProvider services,
     IOptions<SharedAuthenticationOptions> sharedOptions,
     IOptions<OpenIdConnectAuthenticationOptions> options,
     ConfigureOptions<OpenIdConnectAuthenticationOptions> configureOptions = null,
     OpenIdConnectAuthenticationHandler handler = null
     )
 : base(next, dataProtectionProvider, loggerFactory, encoder, services, sharedOptions, options, configureOptions)
 {
     _handler = handler;
     var customFactory = loggerFactory as InMemoryLoggerFactory;
     if (customFactory != null)
         Logger = customFactory.Logger;
 }
        public OpenIdConnectAuthenticationMiddlewareForTestingAuthenticate(
            RequestDelegate next,
            IDataProtectionProvider dataProtectionProvider,
            ILoggerFactory loggerFactory,
            IUrlEncoder encoder,
            IServiceProvider services,
            IOptions <ExternalAuthenticationOptions> externalOptions,
            IOptions <OpenIdConnectAuthenticationOptions> options,
            ConfigureOptions <OpenIdConnectAuthenticationOptions> configureOptions = null,
            OpenIdConnectAuthenticationHandler handler = null
            )
            : base(next, dataProtectionProvider, loggerFactory, encoder, services, externalOptions, options, configureOptions)
        {
            _handler = handler;
            var customFactory = loggerFactory as InMemoryLoggerFactory;

            if (customFactory != null)
            {
                Logger = customFactory.Logger;
            }
        }
 private static TestServer CreateServer(ConfigureOptions<OpenIdConnectAuthenticationOptions> configureOptions, IUrlEncoder encoder, ILoggerFactory loggerFactory, OpenIdConnectAuthenticationHandler handler = null)
 {
     return TestServer.Create(
         app =>
         {
             app.UseMiddleware<OpenIdConnectAuthenticationMiddlewareForTestingAuthenticate>(configureOptions, encoder, loggerFactory, handler);
             app.Use(async (context, next) =>
             {
                 await next();
             });
         },
         services =>
         {
             services.AddWebEncoders();
             services.AddDataProtection();
         }
     );
 }
 private static TestServer CreateServer(ConfigureOptions <OpenIdConnectAuthenticationOptions> configureOptions, IUrlEncoder encoder, ILoggerFactory loggerFactory, OpenIdConnectAuthenticationHandler handler = null)
 {
     return(TestServer.Create(
                app =>
     {
         app.UseMiddleware <OpenIdConnectAuthenticationMiddlewareForTestingAuthenticate>(configureOptions, encoder, loggerFactory, handler);
         app.Use(async(context, next) =>
         {
             await next();
         });
     },
                services =>
     {
         services.AddWebEncoders();
         services.AddDataProtection();
     }
                ));
 }