public static IApplicationBuilder UseOnlyApiAuthentication(this IApplicationBuilder builder, OnlyApiAuthenticationOptions options)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

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

            return(builder.UseMiddleware <OnlyApiAuthenticationOptions>(Options.Create(options)));
        }
Esempio n. 2
0
 public OnlyApiAuthenticationMiddleware(RequestDelegate next, IOptions <OnlyApiAuthenticationOptions> options)
 {
     this._next    = next;
     this._options = options.Value;
 }