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))); }
public OnlyApiAuthenticationMiddleware(RequestDelegate next, IOptions <OnlyApiAuthenticationOptions> options) { this._next = next; this._options = options.Value; }