public AuthController( IUserManager userManager, ICaptchaValidationService captchaValidationService, IUserToSService userToSService, IResetPasswordService resetPasswordService, ISignInResponseProvider signInResponseProvider, IUserActiveStatusProvider userActiveStatusProvider, ISetInvitationAcceptedService setInvitationAcceptedService, IOtpSignInValidationService otpSignInValidationService, IOtpAuthTokenProvider otpAuthTokenProvider, IJwtSecurityTokenValidator jwtSecurityTokenValidator, ITokenValidationParametersProvider tokenValidationParametersProvider, IUserIdFromOtpTokenProvider userIdFromOtpTokenProvider) { _userManager = userManager; _userToSService = userToSService; _captchaValidationService = captchaValidationService; _resetPasswordService = resetPasswordService; _signInResponseProvider = signInResponseProvider; _userActiveStatusProvider = userActiveStatusProvider; _setInvitationAcceptedService = setInvitationAcceptedService; _otpSignInValidationService = otpSignInValidationService; _otpAuthTokenProvider = otpAuthTokenProvider; _jwtSecurityTokenValidator = jwtSecurityTokenValidator; _tokenValidationParametersProvider = tokenValidationParametersProvider; _userIdFromOtpTokenProvider = userIdFromOtpTokenProvider; }
public AccountController( IIdentityServerInteractionService interaction, IClientStore clientStore, SignInManager <ApplicationUser> signInManager, UserManager <ApplicationUser> userManager, IAuthenticationSchemeProvider schemeProvider, IEventService events, IRegistrationService registrationService, IForgotPasswordService forgotPasswordService, IResetPasswordService resetPasswordService, ILoginService loginService, IGeoService geoService, IOptions <AppSettings> settings) { // if the TestUserStore is not in DI, then we'll just use the global users collection // this is where you would plug in your own custom identity management library (e.g. ASP.NET Identity) _interaction = interaction; _clientStore = clientStore; _signInManager = signInManager; _userManager = userManager; _schemeProvider = schemeProvider; _settings = settings; _events = events; _registrationService = registrationService; _forgotPasswordService = forgotPasswordService; _resetPasswordService = resetPasswordService; _loginService = loginService; _geoService = geoService; }
public AccountController(ClaimsPrincipal caller, IAccountService accountService, IBusClient rawRabbitBus, IResetPasswordService resetpasswordService) { _caller = caller; _resetpasswordService = resetpasswordService; _rawRabbitBus = rawRabbitBus; _accountService = accountService; }
public AuthController(IAuthService authService, ITokenClaimsManager tokenClaimsManager, IResetPasswordService resetPasswordService) { this.authService = authService; this.tokenClaimsManager = tokenClaimsManager; this.resetPasswordService = resetPasswordService; }
public ResetPasswordController(IResetPasswordService resetPasswordService, IHttpContextAccessor httpContextAccessor , IOptions <AppSettings> appSettings) { _resetPasswordService = resetPasswordService; _httpContextAccessor = httpContextAccessor; _appSettings = appSettings; }
public ResetPasswordApiController(IResetPasswordService service , ILogger <ResetPasswordApiController> logger , IAuthenticationService <int> authService) : base(logger) { _service = service; _authService = authService; }
public ForgotPasswordPageModel(UserManager <User> userManager, IResetPasswordService resetPasswordService, ILogger <ForgotPasswordPageModel> logger) { _userManager = userManager; _resetPasswordService = resetPasswordService; _logger = logger; }
public LoginController(IResetPasswordService resetPasswordService, IUniquePageService uniquePageService, ILoginService loginService, IStringResourceProvider stringResourceProvider, IUserLookup userLookup) { _resetPasswordService = resetPasswordService; _uniquePageService = uniquePageService; _loginService = loginService; _stringResourceProvider = stringResourceProvider; _userLookup = userLookup; }
public LoginController(IUserService userService, IResetPasswordService resetPasswordService, IAuthorisationService authorisationService, IUniquePageService uniquePageService, ILoginService loginService, IStringResourceProvider stringResourceProvider) { _userService = userService; _resetPasswordService = resetPasswordService; _authorisationService = authorisationService; _uniquePageService = uniquePageService; _loginService = loginService; _stringResourceProvider = stringResourceProvider; }
public AccountController( ApplicationUserManager userManager, ApplicationSignInManager signInManager, IResetPasswordService resetPasswordService, IEmailMessageService emailMessageService ) { _resetPasswordService = resetPasswordService; _userManager = userManager; _signInManager = signInManager; _emailMessageService = emailMessageService; }
public AccountController(ILogger <AccountController> logger, ILoginUserService loginUserService, ILogoutUserService logoutUserService, IRegisterUserService registerUserService, IConfirmAccountService confirmAccountService, ISendEmailConfirmationService sendEmailConfirmationService, IListUserService listUserService, IUpdateUserService updateUserService, IResetPasswordService resetPasswordService) { _logger = logger; _listUserService = listUserService; _loginUserService = loginUserService; _logoutUserService = logoutUserService; _updateUserService = updateUserService; _registerUserService = registerUserService; _confirmAccountService = confirmAccountService; _sendEmailConfirmationService = sendEmailConfirmationService; _resetPasswordService = resetPasswordService; }
private RegisterForm ResetUserPassword(RegisterForm registerForm, IResetPasswordService passwordService) { MembershipUser user; registerForm.PasswordChanged = false; if (passwordService.IsResetUrlValid(registerForm.Token, out user)) { passwordService.ChangePassword(user, registerForm.Password, registerForm.Token); registerForm.PasswordChanged = true; } return(registerForm); }
public LoginController(IResetPasswordService resetPasswordService, IUniquePageService uniquePageService, ILoginService loginService, IStringResourceProvider stringResourceProvider, IUserLookup userLookup, ILogUserIn logUserIn, ISetVerifiedUserData setVerifiedUserData) { _resetPasswordService = resetPasswordService; _uniquePageService = uniquePageService; _loginService = loginService; _stringResourceProvider = stringResourceProvider; _userLookup = userLookup; _logUserIn = logUserIn; _setVerifiedUserData = setVerifiedUserData; }
public void SetUp() { _resetPasswordService = Substitute.For<IResetPasswordService>(); _taskManager = Substitute.For<ITaskManager>(); _authenticationProvider = Substitute.For<IAuthProvider>(); _target = new ResetPasswordController(_resetPasswordService, _taskManager, _authenticationProvider); _viewContext = new ViewContext(); _viewContext.HttpContext = MockHttpContext.FakeHttpContext(); _target.SetFakeControllerContext(_viewContext.HttpContext); _target.CommitProviderInstance = Substitute.For<ICommitProvider>(); _sessionId = Guid.NewGuid().ToString().Replace("-", ""); }
public LoginControllerTests() { _userService = A.Fake <IUserService>(); _resetPasswordService = A.Fake <IResetPasswordService>(); _authorisationService = A.Fake <IAuthorisationService>(); _loginService = A.Fake <ILoginService>(); _uniquePageService = A.Fake <IUniquePageService>(); _loginController = new LoginController(_userService, _resetPasswordService, _authorisationService, _uniquePageService, _loginService, A.Fake <IStringResourceProvider>()); // initial setup as this is reused A.CallTo(() => _uniquePageService.RedirectTo <LoginPage>(null)).Returns(new RedirectResult("~/login-page")); A.CallTo(() => _uniquePageService.RedirectTo <ForgottenPasswordPage>(null)) .Returns(new RedirectResult("~/forgotten-password")); }
public LoginControllerTests() { _userService = A.Fake<IUserService>(); _resetPasswordService = A.Fake<IResetPasswordService>(); _authorisationService = A.Fake<IAuthorisationService>(); _loginService = A.Fake<ILoginService>(); _uniquePageService = A.Fake<IUniquePageService>(); _loginController = new LoginController(_userService, _resetPasswordService, _authorisationService, _uniquePageService, _loginService, A.Fake<IStringResourceProvider>()); // initial setup as this is reused A.CallTo(() => _uniquePageService.RedirectTo<LoginPage>(null)).Returns(new RedirectResult("~/login-page")); A.CallTo(() => _uniquePageService.RedirectTo<ForgottenPasswordPage>(null)) .Returns(new RedirectResult("~/forgotten-password")); }
public SecurityController(ISecurityService securityService, IAuditService loginDeviceAuditService, ITokenStoreService tokenStoreService, IResetPasswordService resetPasswordService, IDeviceProfileConnectionService deviceProfileConnectionService, IDeviceService deviceService, IManufacturerService manufacturerService) { _securityService = securityService; _loginDeviceAuditService = loginDeviceAuditService; _tokenStoreService = tokenStoreService; _resetPasswordService = resetPasswordService; _deviceProfileConnectionService = deviceProfileConnectionService; _deviceService = deviceService; _manufacturerService = manufacturerService; }
public ActionResult ResetPassword(LoginPage currentPage, RegisterForm resetPasswordForm) { if (!ModelState.IsValid) { return(ResetPassword(currentPage, resetPasswordForm.Token)); } var model = new ResetPasswordViewModel(currentPage); if (ModelState.IsValid) { // registerForm.SanitizeInput(); IResetPasswordService passwordService = ServiceLocator.Current.GetInstance <IResetPasswordService>(); if (!passwordService.IsValidPassword(resetPasswordForm.Password)) { // Logger.Info("Too weak password"); var errorMessage = _localizationService.GetString("/common/account/too_weak_password"); ModelState.AddModelError("ResetPasswordForm.ValidationMessage", errorMessage); } else { model.ResetPasswordForm = ResetUserPassword(resetPasswordForm, passwordService); } } if (resetPasswordForm.PasswordConfirm != resetPasswordForm.Password) { var errorMessage = _localizationService.GetString("/common/validation/compare_passwords"); ModelState.AddModelError("ResetPasswordForm.ValidationMessage", errorMessage); ModelState.Remove("ResetPasswordForm.Password"); ModelState.Remove("ResetPasswordForm.VerifyPassword"); } if (!ModelState.IsValid) { _metrics.Count("Users", "Password Reset Failed"); return(View(model)); } _metrics.Count("Users", "Password Reset"); return(Index(currentPage)); }
public ResetPasswordController(IUserProfileRepository userProfileRepository, IResetPasswordService resetPasswordService, EmailMessengerFactory emailMessengerFactory) { if (userProfileRepository == null) { throw new ArgumentNullException("userProfileRepository"); } if (resetPasswordService == null) { throw new ArgumentNullException("resetPasswordService"); } if (emailMessengerFactory == null) { throw new ArgumentNullException("emailMessengerFactory"); } this.userProfileRepository = userProfileRepository; this.resetPasswordService = resetPasswordService; this.emailMessengerFactory = emailMessengerFactory; }
public async Task <IActionResult> ResetPassword([FromBody] ResetPasswordDto resetPasswordDto, [FromServices] IResetPasswordService service) { var resetPasswordValidator = new ResetPasswordValidator(); var validatorResult = await resetPasswordValidator.ValidateAsync(resetPasswordDto); if (validatorResult.IsValid) { await service.ResetPassword(resetPasswordDto); if (!service.Status.HasErrors) { return(Ok()); } return(BadRequest(service.Status.Errors)); } var validationErrors = validatorResult.Errors.Select(error => new ValidationResult(error.ErrorMessage)) .ToImmutableList(); return(BadRequest(validationErrors)); }
public ResetPasswordController(IResetPasswordService resetPasswordService, ITaskManager taskManager, IAuthProvider authenticationProvider) { _resetPasswordService = resetPasswordService; _taskManager = taskManager; _authenticationProvider = authenticationProvider; }
public AccountController(IAccountService accountService, IBusClient rawRabbitBus, IResetPasswordService resetpasswordService) { _resetpasswordService = resetpasswordService; _rawRabbitBus = rawRabbitBus; _accountService = accountService; }
public void SetUp() { _usersManagement = Substitute.For<IUsersManagement>(); _resetPasswordService = new ResetPasswordService(_usersManagement); _sessionId = Guid.NewGuid().ToString().Replace("-", ""); }
public ResetPasswordCommandHandler(IResetPasswordService service, IUnitOfWork unitOfWork) { _service = service; _unitOfWork = unitOfWork; }
public AccountController(IUserService userService, IResetPasswordService resetPasswordService, IMapper mapper) { _userService = userService; _resetPasswordService = resetPasswordService; _mapper = mapper; }
public AuthorizeController(IAuthService authorizationService, IResetPasswordService resetPasswordService, ILogger <AuthorizeController> logger) { _authorizationService = authorizationService ?? throw new ArgumentNullException(nameof(authorizationService)); _resetPasswordService = resetPasswordService ?? throw new ArgumentNullException(nameof(resetPasswordService)); _logger = logger ?? throw new ArgumentNullException(nameof(resetPasswordService)); }