Ejemplo 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;
 }
Ejemplo 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();
        }
Ejemplo n.º 4
0
 public AccountController(MyIdentityContext context)
 {
     this.context = context;
 }