Files
Swarm/DysonNetwork.Shared/Auth/Startup.cs
2025-09-18 01:02:25 +08:00

25 lines
743 B
C#

using DysonNetwork.Shared.Proto;
using DysonNetwork.Shared.Registry;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace DysonNetwork.Shared.Auth;
public static class DysonAuthStartup
{
public static IServiceCollection AddDysonAuth(
this IServiceCollection services
)
{
services.AddAuthService();
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = AuthConstants.SchemeName;
options.DefaultChallengeScheme = AuthConstants.SchemeName;
})
.AddScheme<DysonTokenAuthOptions, DysonTokenAuthHandler>(AuthConstants.SchemeName, _ => { });
return services;
}
}