Results 1 to 5 of 5

Thread: [SOLVED] Authentication token

  1. #1
    Join Date
    Apr 2008
    Posts
    16
    Rep Power
    7

    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 03:43 PM.

  2. #2
    Join Date
    May 2008
    Posts
    45
    Rep Power
    7

    Default

    Check this thread here

  3. #3
    Join Date
    Apr 2008
    Posts
    16
    Rep Power
    7

    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?

  4. #4
    Join Date
    May 2008
    Posts
    45
    Rep Power
    7

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

  5. #5
    Join Date
    Apr 2008
    Posts
    16
    Rep Power
    7

    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.

Similar Threads

  1. Does Zimbra support IMAP Secure Authentication?
    By zzzzsg in forum Administrators
    Replies: 6
    Last Post: 11-06-2009, 07:19 PM
  2. [SOLVED] Zimbra logwatch.
    By nishith in forum Administrators
    Replies: 5
    Last Post: 06-10-2009, 05:42 PM
  3. Authentication to external ldap stop working.
    By jahaj in forum Installation
    Replies: 3
    Last Post: 12-05-2006, 03:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •