Sky.Net/API/Extensions/IdentityServiceExtensions.cs

21 lines
647 B
C#
Raw Normal View History

2022-05-19 13:50:10 -07:00
using Core.Entities.Identity;
using Infrastructure.Identity;
using Microsoft.AspNetCore.Identity;
namespace API.Extensions
{
public static class IdentityServiceExtensions
{
public static IServiceCollection AddIdentityServices(this IServiceCollection services)
{
var builder = services.AddIdentityCore<AppUser>();
builder = new IdentityBuilder(builder.UserType, builder.Services);
builder.AddEntityFrameworkStores<AppIdentityDbContext>();
builder.AddSignInManager<SignInManager<AppUser>>();
services.AddAuthentication();
return services;
}
}
}