public BasicAuthenticateMiddleware(
     RequestDelegate next
     , ILogger <BasicAuthenticateMiddleware> logger
     , string pathMatch
     , BasicAuthAuthorizationFilterOptions options)
 {
     _next      = next;
     _logger    = logger;
     _pathMatch = pathMatch;
     _options   = options;
 }
        public static IApplicationBuilder UseBasicAuthenticate(this IApplicationBuilder app, string pathMatch, Action <BasicAuthAuthorizationFilterOptions> setupOptions)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }
            if (pathMatch == null)
            {
                throw new ArgumentNullException(nameof(pathMatch));
            }
            if (setupOptions == null)
            {
                throw new ArgumentNullException(nameof(setupOptions));
            }

            var options = new BasicAuthAuthorizationFilterOptions();

            setupOptions(options);

            app.UseMiddleware <BasicAuthenticateMiddleware>(pathMatch, options);

            return(app);
        }