exactc sequence Hi
I had the same problem too, I starded grom the getMsg.pl script and
solved it as follow (perl code)
my $adm = new XmlDoc;
$adm->start('AuthRequest', "urn:zimbraAdmin");
$adm->add('name', undef, undef, $admin );
$adm->add('password', undef, undef, $adminPsw);
$adm->end();
# Authenticate as admin
my $admAuthResponse = $SOAP->invoke($admUrl, $adm->root());
#print "Admin AuthResponse = ".$admAuthResponse->to_string("pretty")."\n";
my $admAuthToken = $admAuthResponse->find_child('authToken')->content;
#print "admAuthToken $admAuthToken\n";
my $admContext = $SOAP->zimbraContext($admAuthToken, $admin);
# my $admContextStr = $admContext->to_string("pretty");
# print "admContextStr $admContextStr\n";
my $delega = new XmlDoc;
$delega->start('DelegateAuthRequest', "urn:zimbraAdmin");
# print $userId."\n";
$delega->add('account', undef, { by => "name"}, $userId );
$delega->end();
# Get a new auth token that is valid for $userId
my $delegaAuthResponse = $SOAP->invoke($admUrl, $delega->root(),$admContext);
# print "Delega AuthResponse = ".$delegaAuthResponse->to_string("pretty")."\n";
my $delegaAuthToken = $delegaAuthResponse->find_child('authToken')->content;
my $newContext = $SOAP->zimbraContext($delegaAuthToken, $userId);
first I authenticate as admin
then obtain a delegated authtoken
from the new authtoken I retrieve the newContext that I can use instead of the old context obtained authenticating the user
Last edited by lfasci; 07-13-2007 at 08:59 AM..
|