Search in sources :

Example 1 with ChangePasswordRequest

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);
}
Also used : AccountSelector(com.zimbra.soap.type.AccountSelector) ChangePasswordResponse(com.zimbra.soap.account.message.ChangePasswordResponse) ChangePasswordRequest(com.zimbra.soap.account.message.ChangePasswordRequest)

Example 2 with ChangePasswordRequest

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);
}
Also used : AccountSelector(com.zimbra.soap.type.AccountSelector) ChangePasswordRequest(com.zimbra.soap.account.message.ChangePasswordRequest) Test(org.junit.Test)

Example 3 with ChangePasswordRequest

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));
}
Also used : AccountSelector(com.zimbra.soap.type.AccountSelector) AccountSelector(com.zimbra.soap.type.AccountSelector) ChangePasswordRequest(com.zimbra.soap.account.message.ChangePasswordRequest)

Aggregations

ChangePasswordRequest (com.zimbra.soap.account.message.ChangePasswordRequest)3 AccountSelector (com.zimbra.soap.type.AccountSelector)3 ChangePasswordResponse (com.zimbra.soap.account.message.ChangePasswordResponse)1 Test (org.junit.Test)1