Example #1
0
 public OnlyAuthenticationMiddleware(RequestDelegate next, IOptions <OnlyAuthenticationOptions> options)
 {
     this._next    = next;
     this._options = options.Value;
 }
        public static IApplicationBuilder UseOnlyAuthentication(this IApplicationBuilder builder, OnlyAuthenticationOptions options)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            return(builder.UseMiddleware <OnlyAuthenticationOptions>(Options.Create(options)));
        }