Ejemplo n.º 1
0
        public RemAuthenticationMiddleware(RequestDelegate next, IOptions <RemAuthenticationOptions> options)
        {
            _next = next ?? throw new ArgumentNullException(nameof(next));

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

            _options = options.Value;
        }
Ejemplo n.º 2
0
        //
        // Summary:
        //     Adds the RemAuthenticationMiddleware to the
        //     specified Microsoft.AspNetCore.Builder.IApplicationBuilder, which enables authentication
        //     capabilities for Restricted Countries.
        //
        // Parameters:
        //   app:
        //     The Microsoft.AspNetCore.Builder.IApplicationBuilder to add the middleware to.
        //
        // Returns:
        //     A reference to this instance after the operation has completed.

        public static IApplicationBuilder UseRemAuthentication(this IApplicationBuilder app, RemAuthenticationOptions options)
        {
            return(app.UseMiddleware <RemAuthenticationMiddleware>(Options.Create(options)));
        }