public static UserManagerToken Create(IdentityFactoryOptions <UserManagerToken> options, IOwinContext context) { var appDbContext = context.Get <DbContext.IdentityDbContext>(); var appUserManager = new UserManagerToken(new IdentityUserStore(appDbContext)); appUserManager.UserValidator = new UserValidator <User, Guid>(appUserManager) { AllowOnlyAlphanumericUserNames = true, RequireUniqueEmail = true }; appUserManager.PasswordValidator = new PasswordValidator { RequiredLength = Commons.Constants.PasswordMinLenght, RequireNonLetterOrDigit = true, RequireDigit = true, RequireLowercase = true, RequireUppercase = true, }; appUserManager.EmailService = new EmailService(); var dataProtectionProvider = options.DataProtectionProvider; if (dataProtectionProvider != null) { appUserManager.UserTokenProvider = new DataProtectorTokenProvider <User, Guid>(dataProtectionProvider.Create(Commons.Constants.DataProtectorTokenProviderPurposes)) { TokenLifespan = TimeSpan.FromMinutes(Commons.Constants.TokenLifespanMinutes) }; } return(appUserManager); }
public SignInManagerToken(UserManagerToken userManager, IAuthenticationManager authenticationManager) : base(userManager, authenticationManager) { }
public ModelFactory(UserManagerToken userManager) { UserManagerToken = userManager; }