Ejemplo n.º 1
0
        public void ChangePassword(Guid userId, string oldPassword, string newPassword)
        {
            _logger.Debug("Calling AuthenticationService to change the password for the user with Id={0}", userId);
            var succeeded = _userDirectoryProvider.ChangePassword(userId.ToString(), oldPassword, newPassword);

            CheckAndThrowFailureError(succeeded, "Change password failed", ErrorCodes.UserChangePasswordError);
        }
Ejemplo n.º 2
0
        public void ShouldCreateUserAndChangePassword()
        {
            var username  = Guid.NewGuid().ToString();
            var succeeded = _service.CreateUser(username, Password);

            succeeded.Should().BeTrue();

            var changePasswordSucceeded = _service.ChangePassword(username, Password, NewPassword);

            changePasswordSucceeded.Should().BeTrue();

            var authenticationSucceeded = _service.AuthenticateUser(username, NewPassword);

            authenticationSucceeded.Should().BeTrue();
        }