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
  #1 (permalink)  
Old 08-14-2008, 12:14 PM
tsx tsx is offline
Intermediate Member
 
Posts: 16
Question [SOLVED] Authentication token

What is the default timeout for the authentication token? How can I change that?

I'm trying a get all the data from few large mail boxes (~350k mails + ~40k attachments). I'm trying to reuse the authentication token but I'm getting "auth credentials have expired" message after some time.

I'm using SOAP in conjunction with Java.

-tsx

Last edited by tsx; 08-14-2008 at 02:43 PM..
Reply With Quote
  #2 (permalink)  
Old 08-16-2008, 08:55 PM
Active Member
 
Posts: 45
Default

Check this thread here
Reply With Quote
  #3 (permalink)  
Old 08-18-2008, 12:17 PM
tsx tsx is offline
Intermediate Member
 
Posts: 16
Default

Thanks Skenkin, but I couldn't find answer to my question. Am I missing something?

I'm using the SoapHttpTransport class. The authentication tokens for my admin transport as well as user transport are timing out. It appears the timeout seems to be 1 hour.

Here is the piece of code I'm using to authenticate

Code:
Element request = Element.XMLElement.mFactory
                    .createElement(AdminService.DELEGATE_AUTH_REQUEST);

            Element account = request.addElement(AdminService.E_ACCOUNT);
            account.addAttribute(AdminService.A_BY, "id");
            account.setText(accountID);
            Element response = myAdminHttpTransport.invoke(request);
            String authToken = response.getElement(AdminService.E_AUTH_TOKEN)
                    .getText();
            myUserHttpTransport.setAuthToken(authToken);

            String sessionId = response.getAttribute(
                    ZimbraSoapContext.E_SESSION_ID, null);

            if (sessionId != null) {
                myUserHttpTransport.setSessionId(sessionId);
            }
This code doesn't show it, but after authenticating once, I store the session id and authentication token in a pool that I reuse instead of authenticating every time.

How can I increase the timeout for these tokens?
Reply With Quote
  #4 (permalink)  
Old 08-18-2008, 02:56 PM
Active Member
 
Posts: 45
Default

With the following code you can set the time the connection will be available:
Code:
                DelegateAuthResponse dar = sp.delegateAuth(
                        Provisioning.AccountBy.name, userLogin, durationInSecond);
                ZAuthToken authToken = dar.getAuthToken();
                Options options = new Options(authToken, Z_ADMIN_URL);
                ZMailbox zUserMailbox = new ZMailbox(options);
Reply With Quote
  #5 (permalink)  
Old 08-19-2008, 06:33 AM
tsx tsx is offline
Intermediate Member
 
Posts: 16
Default

You are right. I figured it out yesterday. I added the "duration" attribute to my delegate authentication method and everything worked as expected.

I appreciate your help.

Thanks.
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.