Skip to content

Instantly share code, notes, and snippets.

@vmandic
Created May 23, 2019 13:53
Show Gist options
  • Save vmandic/bb041cd1580f4a426007c873b22b117d to your computer and use it in GitHub Desktop.
Save vmandic/bb041cd1580f4a426007c873b22b117d to your computer and use it in GitHub Desktop.
meds-processor, part/4, snippet #20
using System;
using MedsProcessor.WebAPI.Infrastructure;
using Microsoft.AspNetCore.Builder;
namespace MedsProcessor.WebAPI.Extensions
{
public static class IApplicationBuilderExtensions
{
public static IApplicationBuilder UseBasicAuthentication(
this IApplicationBuilder app,
Action<BasicAuthOptions> configureBasicAuthOpts)
{
var opts = new BasicAuthOptions();
configureBasicAuthOpts(opts);
return app.UseMiddleware<BasicAuthMiddleware>(opts);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment