Created
May 23, 2019 13:53
-
-
Save vmandic/bb041cd1580f4a426007c873b22b117d to your computer and use it in GitHub Desktop.
meds-processor, part/4, snippet #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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