Results 1 to 2 of 2

Thread: Authenticating with ZMailbox

  1. #1
    Join Date
    Oct 2009
    Posts
    1
    Rep Power
    6

    Default Authenticating with ZMailbox

    Hi!

    I'm trying to use the ZMailbox class to connect to Zimbra, but I'm facing problems already at authentication. I'm using Jython, but I guess this applies to the zimbra classes in general. I've tried different urls for connecting (port 7071, path "/service/admin/soap", trailing slash), with no luck.

    I'm probably doing some very simple mistake, but I've been unable to get past this so far.

    This test snippet:

    Code:
    from com.zimbra.cs.account.Provisioning import AccountBy
    from com.zimbra.cs.zclient import ZMailbox
    
    opt = ZMailbox.Options()
    opt.setAccount("username")
    opt.setPassword("password")
    opt.setAccountBy(AccountBy.name)
    opt.setUri("https://exampleserver/service/soap")
    mb = ZMailbox.getMailbox(opt)
    results in this error:
    Code:
    Traceback (most recent call last):
      File "test2.py", line 10, in <module>
        mb = ZMailbox.getMailbox(opt)
    ExceptionId:main:1256045363781:6acbc37c5772b034
    Code:service.INVALID_REQUEST
            at com.zimbra.common.service.ServiceException.INVALID_REQUEST(ServiceExc
    eption.java:258)
            at com.zimbra.common.soap.Element.checkNull(Element.java:243)
            at com.zimbra.common.soap.Element.getElement(Element.java:170)
            at com.zimbra.cs.zclient.ZAuthResult.<init>(ZAuthResult.java:37)
            at com.zimbra.cs.zclient.ZMailbox.authByPassword(ZMailbox.java:506)
            at com.zimbra.cs.zclient.ZMailbox.<init>(ZMailbox.java:415)
            at com.zimbra.cs.zclient.ZMailbox.getMailbox(ZMailbox.java:352)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
    
    com.zimbra.common.service.ServiceException: com.zimbra.common.service.ServiceExc
    eption: invalid request: missing required element: authToken
    ExceptionId:main:1256045363781:6acbc37c5772b034
    Code:service.INVALID_REQUEST
    Any kind of help/tip would be much appreciated.

  2. #2
    azwifhtj Guest

    Default Autheenticating with ZMailbox

    Kangis,
    You need to specify the kind of request you perform. In this case something like GET_ADMINAUTH_REQUEST

Similar Threads

  1. Zimbra Authenticating over MySQL instead of LDAP
    By coryodaniel in forum Installation
    Replies: 2
    Last Post: 08-19-2008, 02:04 AM
  2. Authenticating users by group using LDAP?
    By benton in forum Administrators
    Replies: 0
    Last Post: 07-13-2007, 04:42 PM
  3. Authenticating against Zimbra's LDAP Server
    By tstrimp in forum Developers
    Replies: 6
    Last Post: 03-16-2007, 09:26 AM
  4. Replies: 1
    Last Post: 07-28-2006, 07:14 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
  •