• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SignInManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: ManageController

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


示例17: AccountController

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


示例18: AccountController

        public AccountController(UserManager<User> userManager, SignInManager<User> signInManager, CloudContext context, AccountRepository repository)
        {
            _userManager = userManager;
            _signInManager = signInManager;

            Repository = repository;
            CloudContext = context;
        }
开发者ID:stvansolano,项目名称:Moments,代码行数:8,代码来源:AccountController.cs


示例19: AuthRepository

        public AuthRepository(ApplicationDbContext context,
            UserManager<ApplicationUser> userManager,
            SignInManager<ApplicationUser> signInManager) {
            this.db = context;
            this.userManager = userManager;
            this.signInManager = signInManager;

        }
开发者ID:damccull,项目名称:MVC6BearerTokens,代码行数:8,代码来源:AuthRepository.cs


示例20: AccountController

 public AccountController(UserManager<ApplicationUser> userManager, SignInManager<ApplicationUser> signInManager, IEmailSender emailSender, ISmsSender smsSender, ILogger<AccountController> logger)
 {
     _userManager = userManager;
     _signInManager = signInManager;
     _emailSender = emailSender;
     _smsSender = smsSender;
     _logger = logger;
 }
开发者ID:yvaravko,项目名称:JuveV,代码行数:8,代码来源:AccountController.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SignInRequestMessage类代码示例发布时间:2022-05-24
下一篇:
C# Sign类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap