21 lines
647 B
C#
21 lines
647 B
C#
|
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;
|
||
|
}
|
||
|
}
|
||
|
}
|