当前位置: 首页>>代码示例>>C#>>正文


C# SignInManager类代码示例

本文整理汇总了C#中SignInManager的典型用法代码示例。如果您正苦于以下问题:C# SignInManager类的具体用法?C# SignInManager怎么用?C# SignInManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SignInManager类属于命名空间,在下文中一共展示了SignInManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MeApiController

 public MeApiController(UserManager<ApplicationUser> userManager,
     SignInManager<ApplicationUser> signInManager,
     IMediator mediator)
 {
     _userManager = userManager;
     _signInManager = signInManager;
     _mediator = mediator;
 }
开发者ID:nicolastarzia,项目名称:allReady,代码行数:8,代码来源:MeApiController.cs

示例2: LoginController

 public LoginController(
     SignInManager signInManager,
     SignInInteraction signInInteraction)
 {
     _signInManager = signInManager;
     _signInInteraction = signInInteraction;
 }
开发者ID:TrabacchinLuigi,项目名称:IdentityServer4.EntityFramework,代码行数:7,代码来源:LoginController.cs

示例3: AccountController

 public AccountController(
     SignInManager<Identity> signInManager,
     ILoggerFactory loggerFactory)
 {
     _signInManager = signInManager;
     _logger = loggerFactory.CreateLogger<AccountController>();
 }
开发者ID:kbok,项目名称:OkMidnight,代码行数:7,代码来源:AccountController.cs

示例4: WeekBasketManagementController

        public WeekBasketManagementController(ApplicationDbContext context, IHostingEnvironment environment,
            UserManager<ApplicationUser> userManager,
            SignInManager<ApplicationUser> signInManager,
            IServiceProvider serviceProvider) : base(serviceProvider, userManager, context, environment, signInManager)
        {

        }
开发者ID:ChavFDG,项目名称:Stolons,代码行数:7,代码来源:WeekBasketManagementController.cs

示例5: UserService

 public UserService(UserManager<User, int> userManager, SignInManager<User, int> signinManager
     , IAuthenticationManager authManager)
 {
     _userManager = userManager;
     _signinManager = signinManager;
     _authManager = authManager;
 }
开发者ID:stoneflyop1,项目名称:AspNetIdentity-Owin,代码行数:7,代码来源:IUserService.cs

示例6: AccountController

 public AccountController(
     UserManager<ApplicationUser> userManager,
     SignInManager<ApplicationUser> signInManager)
 {
     UserManager = userManager;
     SignInManager = signInManager;
 }
开发者ID:leloulight,项目名称:MusicStore,代码行数:7,代码来源:AccountController.cs

示例7: AccountController

 public AccountController(IConfigurationRoot appSettings, UserManager<ApplicationUser> userManager, SignInManager<ApplicationUser> signInManager, ILoggerFactory loggerFactory)
 {
     _appSettings = appSettings;
     _userManager = userManager;
     _signInManager = signInManager;
     _logger = loggerFactory.CreateLogger<AccountController>();
 }
开发者ID:pmalmeida,项目名称:AspNet5AngularV2,代码行数:7,代码来源:AccountController.cs

示例8: MockAccountController

        private static AccountController MockAccountController(SignInManager<ApplicationUser> mockSignInManager, UserManager<ApplicationUser> mockUserManager)
        {
            var mockEmailSender = new Mock<IEmailSender>();
            var mockSmsSender = new Mock<ISmsSender>();
            var mockApplicationDbContext = new Mock<ApplicationDbContext>();
            var mockEmailTemplate = new Mock<IEmailTemplate>();
            var mockNullLoggerFactory = new NullLoggerFactory();


            var mockLocalizer = new Mock<IStringLocalizer<AccountController>>();
            mockLocalizer.Setup(m => m[It.IsAny<string>()])
                .Returns<string>(x => new LocalizedString(x, x, false));
            mockLocalizer.Setup(m => m[It.IsAny<string>(), It.IsAny<object>()])
                .Returns<string, object[]>((x, y) => new LocalizedString(x, string.Format(x, y), false));

            var controller = new AccountController(mockUserManager, mockSignInManager, mockEmailSender.Object, mockSmsSender.Object, mockNullLoggerFactory, mockApplicationDbContext.Object, mockEmailTemplate.Object, mockLocalizer.Object);

            var mockUrl = new Mock<IUrlHelper>();
            mockUrl.Setup(m => m.IsLocalUrl("localUrl")).Returns(true);
            mockUrl.Setup(m => m.IsLocalUrl("remoteUrl")).Returns(false);

            controller.Url = mockUrl.Object;

            return controller;
        }
开发者ID:Pietervdw,项目名称:DBC,代码行数:25,代码来源:AccountControllerTest.cs

示例9: AccountController

 public AccountController(UserManager<ApplicationUser> userMgr, SignInManager<ApplicationUser> signInMgr, ILogger<AccountController> log)
 {
    
     userManager = userMgr;
     signInManager = signInMgr;
     logger = log;
 }
开发者ID:mgolois,项目名称:DivineChMS,代码行数:7,代码来源:AccountController.cs

示例10: AccountController

 public AccountController(
     UserManager<User> userManager,
     SignInManager<User> signInManager)
 {
     _signInManager = signInManager;
     _userManager = userManager;
 }
开发者ID:jchenga,项目名称:Orchard2,代码行数:7,代码来源:AccountController.cs

示例11: UsersController

 public UsersController(ApplicationDbContext context, IHostingEnvironment environment,
     UserManager<ApplicationUser> userManager,
     SignInManager<ApplicationUser> signInManager,
     IServiceProvider serviceProvider)
     : base(context,environment,userManager,signInManager,serviceProvider)
 {
 }
开发者ID:ChavFDG,项目名称:Stolons,代码行数:7,代码来源:UsersController.cs

示例12: AppController

 public AppController(IHttpContextAccessor httpContextAccessor,
         UserManager<MyUser> userManager,
         IOptions<IdentityOptions> optionsAccessor)
 {
     SignInManager = new MySignInManager(userManager as MyUserManager, httpContextAccessor, new MyClaimsPrincipleFactory());
     UserManager = userManager;
 }
开发者ID:HeathWillCode,项目名称:ASPNET5-FormAuthenticationLDAP,代码行数:7,代码来源:AppController.cs

示例13: UserController

 public UserController(SignInManager<ChirpUser> a_signInManager, UserManager<ChirpUser> a_userManager, ILogger<UserController> a_logger, IEmailSender a_emailSender)
 {
     m_signInManager = a_signInManager;
     m_userManager = a_userManager;
     m_logger = a_logger;
     m_emailSender = a_emailSender;
 }
开发者ID:SteveF92,项目名称:Chirp,代码行数:7,代码来源:UserController.cs

示例14: UserManagerService

        public UserManagerService(UserManager<AppIdentityUser> userMenager, IAuthenticationManager authenticationManager, RoleManager<IdentityRole> roleManager)
        {
            this._userMenager = userMenager;
            this._authenticationManager = authenticationManager;
            this._roleManager = roleManager;

            //Pasword validation rules

            _userMenager.UserValidator = new UserValidator<AppIdentityUser>(userMenager) { RequireUniqueEmail = true, AllowOnlyAlphanumericUserNames = false };
            _userMenager.PasswordValidator = new PasswordValidator() { RequiredLength = 6, RequireLowercase = true, RequireUppercase = true, RequireDigit = true };
            _signInMenager = new SignInManager<AppIdentityUser, string>(_userMenager, _authenticationManager);

            //_userMenager.UserLockoutEnabledByDefault = true;
            //_userMenager.DefaultAccountLockoutTimeSpan = TimeSpan.FromDays(int.MaxValue);
            //_userMenager.SetLockoutEnabled(user.Id, enabled) // Enables or disables lockout for a user 
            //Register e-mail service for identity

            _userMenager.EmailService = new EmailService();

            //Token provider for password reset
            var dataProtectionProvider = Startup.dataProtectionProvider;
            if (dataProtectionProvider != null)
            {
                IDataProtector dataProtector = dataProtectionProvider.Create("ASP.NET Identity");
                userMenager.UserTokenProvider = new DataProtectorTokenProvider<AppIdentityUser>(dataProtector);
            }
        }
开发者ID:BeczkaPGS,项目名称:ForGrzesiekToReview,代码行数:27,代码来源:UserManagerService.cs

示例15: IdentityServices

        public IdentityServices(DbContext context, IAuthenticationManager authenticationMana, UserStore<IdentityUser> userStor, UserManager<IdentityUser> userMena)
        {
            db = context;
            userStore = userStor;
            userMenager = userMena;
            authenticationManager = authenticationMana;

            userMenager.UserValidator = new UserValidator<IdentityUser>(userMenager) { RequireUniqueEmail = true, AllowOnlyAlphanumericUserNames = false };
            userMenager.PasswordValidator = new PasswordValidator() { RequiredLength = 6, RequireLowercase = true, RequireUppercase = true, RequireDigit = true };

            signInMenager = new SignInManager<IdentityUser, string>(userMenager, authenticationManager);
            
            userMenager.RegisterTwoFactorProvider("EmailCode", new EmailTokenProvider<IdentityUser>
            {
                Subject = "Security Code",
                BodyFormat = "Your security code is {0}"
            });

            userMenager.EmailService = new EmailService();

            var dataProtectionProvider = Startup.dataProtectionProvider;

            if (dataProtectionProvider != null)
            {
                IDataProtector dataProtector = dataProtectionProvider.Create("ASP.NET Identity");
                userMenager.UserTokenProvider = new DataProtectorTokenProvider<IdentityUser>(dataProtector);
            }
        }
开发者ID:gkudel,项目名称:Testility,代码行数:28,代码来源:IdentityServices.cs


注:本文中的SignInManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。