Esempio n. 1
0
        public async void Configure(
            IApplicationBuilder app,
            IWebHostEnvironment env,
            MyIdentityContext context,
            UserManager <MyIdentityUser> userManager,
            RoleManager <IdentityRole> roleManager)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // Start the database with some users and clams.
            var initializer = new IdentityInitializer(context, userManager, roleManager);
            await initializer.Initialize();

            app.UseSwaggerConfiguration();

            app.UseHttpsRedirection();

            app.UseRouting();

            // Custom NetDevPack abstraction here!
            app.UseAuthConfiguration();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
 public AccountController(
     UserManager <MyIdentityUser> userManager,
     SignInManager <MyIdentityUser> signinManager,
     RoleManager <IdentityRole> roleManager,
     MyIdentityContext identityContext)
 {
     _userManager     = userManager;
     _signInManager   = signinManager;
     _roleManager     = roleManager;
     _identityContext = identityContext;
 }
Esempio n. 3
0
        public IdentityController(UserManager <ApiUser> userManager,
                                  MyIdentityContext ctx,
                                  SignInManager <ApiUser> signInManager,
                                  IConfiguration configuration,
                                  IOptions <JwtIssuerOptions> jwtOptions)
        {
            _userManager     = userManager;
            _identityContext = ctx;
            _signInManager   = signInManager;
            _configuration   = configuration;
            _jwtOptions      = jwtOptions.Value;

            //_identityContext.Database.Migrate();
        }
Esempio n. 4
0
 public AccountController(MyIdentityContext context)
 {
     this.context = context;
 }