2024-07-13 16:27:45 +02:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
namespace DotBased.ASP.Auth;
|
|
|
|
|
|
|
|
public static class DotBasedAuthDependencyInjection
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Use the DotBased authentication implementation
|
|
|
|
/// </summary>
|
|
|
|
/// <remarks>Use the app.UseAuthentication() and app.UseAuthorization()!</remarks>
|
2024-07-27 14:38:39 +02:00
|
|
|
/// <param name="services">Service collection</param>
|
2024-07-13 16:27:45 +02:00
|
|
|
/// <param name="configurationAction">DotBased auth configuration</param>
|
2024-07-27 14:38:39 +02:00
|
|
|
public static BasedAuthBuilder UseBasedServerAuth(this IServiceCollection services, Action<BasedAuthConfiguration>? configurationAction = null)
|
2024-07-13 16:27:45 +02:00
|
|
|
{
|
2024-07-27 14:38:39 +02:00
|
|
|
var authBuilder = new BasedAuthBuilder(services, configurationAction);
|
|
|
|
return authBuilder;
|
2024-07-13 16:27:45 +02:00
|
|
|
}
|
|
|
|
}
|