[SOLVED] Delegate Auth Request using pre auth
[SOLVED] Delegate Auth Request using pre auth
I am trying to migrate accounts from one mail system to another using the Zimbra soap API. It is very quick to generate new accounts this way. However it is slow to generate the contacts that go along with these accounts. Right now I have to do an authRequest as the admin and then do a delegate auth request for the account I want to create the contact for and then do a createcontactrequest to make a new contact. So for each contact I have I have to do three requests. Not very fast when the average account I am trying to migrate has over 40 contacts and I am trying to migrate close to 5700 accounts for one of my domains. I would like to just authenticate as an admin and then do a delegateAuthentication as the user I want to make the contacts for and then just spin off all the contacts for that user. The only way I can see to do this is to use the pre auth key somehow but, I am not sure how. If anyone knows how to tackle this problem it will be much appreciated. Thank you
[SOLVED] Delegate Auth Request using pre auth
Anyone?????
[SOLVED] Delegate Auth Request using pre auth
Nevermind I figured it out.
[SOLVED] Delegate Auth Request using pre auth
Could you please explain how you figured this out or share your implementation. I'm sure you are/were in the same position I am in with useless zimbra docs.
Re: [SOLVED] Delegate Auth Request using pre auth
I would be interested to see how you solved this too
Re: [SOLVED] Delegate Auth Request using pre auth
Ended up figuring it out, here is the solution. But you need to generate a preauth token on your zimbra server
https://wiki.zimbra.com/wiki/Preauth
https://wiki.zimbra.com/wiki/Preauth
Code: Select all
$account = new AccountSelector(AccountBy::NAME(), 'test@domain.com');
$preAuth = new PreAuth(time() * 1000, null, 0);
$preAuth->computeValue($account, INSERT_GENERATE_PREAUTH_TOKEN_HERE );
$api = MailFactory::instance('https://domain.com/service/soap');
$result = $api->auth($account, null, $preAuth);