public Idsr4Service(ILogger <Idsr4Service> logger,
                            CSharpUserManager userManager,
                            CSharpSignInManager signInManager)
        {
            _logger = logger;

            _userManager = userManager;

            _signInManager = signInManager;
        }
Example #2
0
        public static IServiceCollection AddCSharpIdentity <TContext>(this IServiceCollection services)
            where TContext : CSharpJWTContext
        {
            services.AddIdentity <User, Role>(Options => CSharpUserManager.CreateOptions(Options))
            .AddEntityFrameworkStores <TContext>()
            .AddDefaultTokenProviders();

            services.AddScoped <CSharpUserManager, CSharpUserManager>();

            services.AddScoped <CSharpSignInManager, CSharpSignInManager>();

            services.AddScoped <IClientService, ClientService>();

            services.AddScoped <ITokenService, TokenService>();

            return(services);
        }
        public static IServiceCollection AddCSharpJWTIdentity <TContext>(this IServiceCollection services,
                                                                         Action <DbContextOptionsBuilder> optionsAction)
            where TContext : CSharpJWTContext
        {
            services.AddDbContext <TContext>(optionsAction);

            services.AddIdentity <User, Role>(Options => CSharpUserManager.CreateOptions(Options))
            .AddEntityFrameworkStores <TContext>()
            .AddDefaultTokenProviders();

            services.AddScoped <ITokenService, TokenService>();

            return(services
                   .AddCSharpUserManager()
                   .AddCSharpSignInManager()
                   .AddClientService()
                   .AddClaimService());
        }