WIP add API Key authentication

This commit is contained in:
Robert Marshall 2020-06-24 07:47:59 +01:00
parent 005eea35e2
commit 3f1ab3eb12
5 changed files with 104 additions and 2 deletions

View file

@ -0,0 +1,10 @@
using Microsoft.AspNetCore.Authentication;
using System;
namespace Robware.Api.Auth.ApiKey {
public static class AuthenticationBuilderExtensions {
public static AuthenticationBuilder AddApiKeySupport(this AuthenticationBuilder authenticationBuilder, Action<ApiKeyAuthenticationOptions> options) {
return authenticationBuilder.AddScheme<ApiKeyAuthenticationOptions, ApiKeyAuthenticationHandler>(ApiKeyAuthenticationOptions.DefaultScheme, options);
}
}
}