public SwaggerBasicAuthMiddleware(
     RequestDelegate next,
     SwaggerBasicAuthConfiguration configuration)
 {
     _next          = next;
     _configuration = configuration;
 }
Esempio n. 2
0
        public static void UseSwaggerBasicAuth(
            this IApplicationBuilder app,
            Action <SwaggerBasicAuthConfiguration> setupAction = null)
        {
            var config = new SwaggerBasicAuthConfiguration
            {
                SwaggerPath = "/swagger",
                Username    = "******",
                Password    = "******"
            };

            setupAction?.Invoke(config);

            app.UseMiddleware <SwaggerBasicAuthMiddleware>(config);
        }