use of com.zimbra.soap.account.message.ChangePasswordRequest in project zm-mailbox by Zimbra.
the class ZMailbox method changePassword.
private ZChangePasswordResult changePassword(String key, AccountBy by, String oldPassword, String newPassword, String virtualHost) throws ServiceException {
if (mTransport == null) {
throw ZClientException.CLIENT_ERROR("must call setURI before calling changePassword", null);
}
AccountSelector account = new AccountSelector(SoapConverter.TO_SOAP_ACCOUNT_BY.apply(by), key);
ChangePasswordRequest req = new ChangePasswordRequest(account, oldPassword, newPassword);
req.setVirtualHost(virtualHost);
ChangePasswordResponse res = invokeJaxb(req);
return new ZChangePasswordResult(res);
}
use of com.zimbra.soap.account.message.ChangePasswordRequest in project zm-mailbox by Zimbra.
the class TestAccess method ChangePassword.
@Test
public void ChangePassword() throws Exception {
AccountSelector acct = new AccountSelector(com.zimbra.soap.type.AccountBy.name, ACCT_NAME);
ChangePasswordRequest req = new ChangePasswordRequest(acct, PASSWORD, PASSWORD);
accessTest(Perm.PERM_AUTH_TOKEN_IGNORED, req);
// urg, need to re-auth after changing password, because we now
// invalidate auth token after password change.
ACCT = authUser(ACCT_NAME);
}
use of com.zimbra.soap.account.message.ChangePasswordRequest in project zm-mailbox by Zimbra.
the class SoapProvisioning method changePassword.
@Override
public void changePassword(Account acct, String currentPassword, String newPassword) throws ServiceException {
com.zimbra.soap.type.AccountSelector jaxbAcct = new com.zimbra.soap.type.AccountSelector(com.zimbra.soap.type.AccountBy.name, acct.getName());
invokeJaxb(new ChangePasswordRequest(jaxbAcct, currentPassword, newPassword));
}
Aggregations