Page 1 of 1

[SOLVED] Delegate Auth Request using pre auth

Posted: Tue May 20, 2008 1:12 am
by palikero
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

Posted: Wed May 21, 2008 12:19 pm
by palikero
Anyone?????

[SOLVED] Delegate Auth Request using pre auth

Posted: Wed May 21, 2008 5:32 pm
by palikero
Nevermind I figured it out.

[SOLVED] Delegate Auth Request using pre auth

Posted: Tue Mar 31, 2009 4:03 pm
by jporter
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

Posted: Fri Jan 26, 2018 5:25 pm
by undertoe
I would be interested to see how you solved this too :)

Re: [SOLVED] Delegate Auth Request using pre auth

Posted: Mon Jan 29, 2018 9:06 pm
by undertoe
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

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);