Files
the-cycle/src/Prospect.Server.Api/Services/Auth/AuthenticationBuilderExtensions.cs
T
2021-11-01 18:27:08 +01:00

20 lines
959 B
C#

using System;
using Microsoft.AspNetCore.Authentication;
using Prospect.Server.Api.Services.Auth.Entity;
using Prospect.Server.Api.Services.Auth.User;
namespace Prospect.Server.Api.Services.Auth
{
public static class AuthenticationBuilderExtensions
{
public static AuthenticationBuilder AddUserAuthentication(this AuthenticationBuilder authenticationBuilder, Action<UserAuthenticationOptions> options)
{
return authenticationBuilder.AddScheme<UserAuthenticationOptions, UserAuthenticationHandler>(UserAuthenticationOptions.DefaultScheme, options);
}
public static AuthenticationBuilder AddEntityAuthentication(this AuthenticationBuilder authenticationBuilder, Action<EntityAuthenticationOptions> options)
{
return authenticationBuilder.AddScheme<EntityAuthenticationOptions, EntityAuthenticationHandler>(EntityAuthenticationOptions.DefaultScheme, options);
}
}
}