Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old 07-13-2007, 06:05 AM
Zimbra Employee
 
Posts: 1,434
Default No auth token

Let's see. The piece that's failing is
Code:
        Account adminAcct = prov.get(AccountBy.id, lc.getAuthtokenAccountId());
        if (adminAcct == null)
            throw AccountServiceException.NO_SUCH_ACCOUNT(lc.getAuthtokenAccountId());
No auth token would mean lc.getAuthtokenAccountId() is null which means admin account lookup will fail.

So... what does your request look like? Are you sure that you're including the auth token in the <context> block in the SOAP envelope?
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!

Last edited by dkarp; 07-13-2007 at 06:09 AM..
Reply With Quote
  #12 (permalink)  
Old 07-13-2007, 06:45 AM
Trained Alumni
 
Posts: 127
Default 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
__________________
http://www.seacom.it

Last edited by lfasci; 07-13-2007 at 08:59 AM..
Reply With Quote
  #13 (permalink)  
Old 07-15-2007, 09:04 PM
Member
 
Posts: 14
Default And therein lies the key...

Quote:
Originally Posted by lfasci View Post
Hi

# Get a new auth token that is valid for $userId
my $delegaAuthResponse = $SOAP->invoke($admUrl, $delega->root(),$admContext);
My DelegateAuthResponse was not including the Admin Context! Simply added the context I got from the initial AuthRequest and presto, my DelegateAuthResponse was successful!

MANY thanks to all who helped me understand this a little better!
Reply With Quote
  #14 (permalink)  
Old 01-07-2008, 10:57 AM
Junior Member
 
Posts: 9
Default

I have posted this on another thread but this thread seems more 'soap active' so here goes ... hopefully i can get some help ...thanks folks ...

__________________________________________________ ________________

I have major SOAP connectivity issues as well and have almost given up pursuing this. I tried using the Java code mentioned in an earlier post to no avail. Here is my code and the errors are meaningless as i dont have the source code for SoapTransport..

SoapProvisioning sp = new SoapProvisioning();
sp.soapSetURI("https://localhost:7071/zimbraAdmin/");
sp.soapAdminAuthenticate("admin","password");
createZimbraAccount = sp.createAccount("username", "password", getMap());

and my error is ...
at org.apache.commons.logging.LogFactory.getLog(LogFa ctory.java:353)
at org.apache.commons.httpclient.HttpClient.<clinit>( HttpClient.java:69)
at com.zimbra.soap.SoapHttpTransport.<init>(SoapHttpT ransport.java:61)
at ZimbraSoap.createUser(ZimbraSoap.java:173)
at ZimbraSoap.main(ZimbraSoap.java:42)


Ive included zimbrastore.jar into my project along with the other jar files. is your issue similar to this ...
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.