Results 1 to 3 of 3

Thread: [SOLVED] SOAP Problem: CreateAccountRequest returns "no valid authtoken present&

  1. #1
    almanzam is offline New Member
    Join Date
    Aug 2007
    Posts
    4
    Rep Power
    7

    Default [SOLVED] SOAP Problem: CreateAccountRequest returns "no valid authtoken present&

    Greetings, everyone.

    I have a perl script that connects to the Zimbra Admin URN, gets the authToken, and doesn't allow the same authToken. It seems weird that I save the authToken in variables, display it, but then the response is "no valid authtoken present":
    Code:
    SOAP::Transport::HTTP::Client::send_receive: POST https://thenameofmyhost.domainname:7071/service/admin/soap/ HTTP/1.1
    Accept: text/xml
    Accept: multipart/*
    Accept: application/soap
    Content-Length: 566
    Content-Type: application/soap; charset=utf-8
    SOAPAction: "urn:zimbraAdmin#AuthRequest"
    
    <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding" xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><context xmlns="urn:zimbraAdmin" /></soap:Header><soap:Body><AuthRequest xmlns="urn:zimbraAdmin"><name xsi:type="xsd:string">zimbra</name><password xsi:type="xsd:string">******</password></AuthRequest></soap:Body></soap:Envelope>
    SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
    Connection: close
    Date: Tue, 23 Oct 2007 20:38:22 GMT
    Server: Apache-Coyote/1.1
    Content-Length: 603
    Content-Type: text/xml;charset=utf-8
    Client-Date: Tue, 23 Oct 2007 20:40:06 GMT
    Client-Peer: 172.17.34.158:7071
    Client-Response-Num: 1
    Client-SSL-Cert-Issuer: /C=US/ST=NA/L=NA/O=Zimbra/OU=Zimbra/CN=zimbra.uhd.edu
    Client-SSL-Cert-Subject: /C=US/ST=NA/L=NA/O=Zimbra/OU=Zimbra/CN=zimbra.uhd.edu
    Client-SSL-Cipher: EDH-RSA-DES-CBC3-SHA
    Client-SSL-Warning: Peer certificate not verified
    
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><context xmlns="urn:zimbra"><sessionId type="admin" id="23">23</sessionId></context></soap:Header><soap:Body><AuthResponse xmlns="urn:zimbraAdmin"><authToken>0_0ad721a82406c9ff86da8ae112f243258c5d3cf7_69643d33363a65306661666438392d313336302d313164392d383636312d3030306139356439386566323b6578703d31333a313139333231353130323034333b61646d696e3d313a313b</authToken><lifetime>43200000</lifetime><a n="zimbraIsDomainAdminAccount">false</a><sessionId type="admin" id="23">23</sessionId></AuthResponse></soap:Body></soap:Envelope>
    
    OUTPUT ON THE SCREEN FROM MY PERL SCRIPT: 
    Token: "0_0ad721a82406c9ff86da8ae112f243258c5d3cf7_69643d33363a65306661666438392d313336302d313164392d383636312d3030306139356439386566323b6578703d31333a313139333231353130323034333b61646d696e3d313a313b"
    For UserID: "23" 
    
    SOAP::Transport::HTTP::Client::send_receive: POST https://thenameofmyhost.domainname:7071/service/admin/soap/ HTTP/1.1
    Accept: text/xml
    Accept: multipart/*
    Accept: application/soap
    User-Agent: SOAP::Lite/Perl/0.69
    Content-Length: 1009
    Content-Type: application/soap; charset=utf-8
    SOAPAction: "urn:zimbraAdmin#CreateAccountRequest"
    
    <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding" xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><context xmlns="urn:zimbra" /><authToken xsi:type="xsd:string">0_0ad721a82406c9ff86da8ae112f243258c5d3cf7_69643d33363a65306661666438392d313336302d313164392d383636312d3030306139356439386566323b6578703d31333a313139333231353130323034333b61646d696e3d313a313b</authToken><sessionId xsi:type="xsd:int" id="23">23</sessionId></soap:Header><soap:Body><CreateAccountRequest xmlns="urn:zimbraAdmin"><name xsi:type="xsd:string">apellidoe@thenameofmyhost.domainname</name><password /><a n="sn" xsi:type="xsd:string">Apellido</a><a n="givenName" xsi:type="xsd:string">Estudiante</a><a n="displayName" xsi:type="xsd:string">Estudiante Apellido</a></CreateAccountRequest></soap:Body></soap:Envelope>
    SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
    Connection: close
    Date: Tue, 23 Oct 2007 20:38:22 GMT
    Server: Apache-Coyote/1.1
    Content-Length: 2282
    Content-Type: text/xml;charset=utf-8
    Client-Date: Tue, 23 Oct 2007 20:40:06 GMT
    Client-Peer: 172.17.34.158:7071
    Client-Response-Num: 1
    Client-SSL-Cert-Issuer: /C=US/ST=NA/L=NA/O=Zimbra/OU=Zimbra/CN=zimbra.uhd.edu
    Client-SSL-Cert-Subject: /C=US/ST=NA/L=NA/O=Zimbra/OU=Zimbra/CN=zimbra.uhd.edu
    Client-SSL-Cipher: EDH-RSA-DES-CBC3-SHA
    Client-SSL-Warning: Peer certificate not verified
    
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Sender</soap:Value></soap:Code><soap:Reason><soap:Text>no valid authtoken present</soap:Text></soap:Reason><soap:Detail><Error xmlns="urn:zimbra"><Code>service.AUTH_REQUIRED</Code><Trace>com.zimbra.common.service.ServiceException: no valid authtoken present
            at com.zimbra.common.service.ServiceException.AUTH_REQUIRED(ServiceException.java:213)
            at com.zimbra.soap.SoapEngine.dispatchRequest(SoapEngine.java:237)
            at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:168)
            at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:90)
            at com.zimbra.soap.SoapServlet.doPost(SoapServlet.java:223)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
            at com.zimbra.cs.servlet.ZimbraServlet.service(ZimbraServlet.java:162)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:595)
    </Trace></Error></soap:Detail></soap:Fault></soap:Body></soap:Envelope>
    ERROR: $VAR1 = {
              'Detail' => {
                          'Error' => {
                                     'Code' => 'service.AUTH_REQUIRED',
                                     'Trace' => 'com.zimbra.common.service.ServiceException: no valid authtoken present
            at com.zimbra.common.service.ServiceException.AUTH_REQUIRED(ServiceException.java:213)
            at com.zimbra.soap.SoapEngine.dispatchRequest(SoapEngine.java:237)
            at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:168)
            at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:90)
            at com.zimbra.soap.SoapServlet.doPost(SoapServlet.java:223)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
            at com.zimbra.cs.servlet.ZimbraServlet.service(ZimbraServlet.java:162)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:595)
    '
                                   }
                        },
              'Reason' => {
                          'Text' => 'no valid authtoken present'
                        },
              'Code' => {
                        'Value' => 'soap:Sender'
                      }
            };
    By the looks of my request and my responses on the status (using DEBUG to view on standard output), what could I be doing wrong?

    Thanks in advance.

    (first post)
    Last edited by almanzam; 10-23-2007 at 02:38 PM. Reason: security items deleted

  2. #2
    JoshuaPrismon is offline Zimlet Guru & Moderator
    Join Date
    Nov 2005
    Posts
    477
    Rep Power
    9

    Default

    Quote Originally Posted by almanzam View Post
    Greetings, everyone.

    I have a perl script that connects to the Zimbra Admin URN, gets the authToken, and doesn't allow the same authToken. It seems weird that I save the authToken in variables, display it, but then the response is "no valid authtoken present":
    Code:
    SOAP::Transport::HTTP::Client::send_receive: POST https://thenameofmyhost.domainname:7071/service/admin/soap/ HTTP/1.1
    Accept: text/xml
    Accept: multipart/*
    Accept: application/soap
    Content-Length: 566
    Content-Type: application/soap; charset=utf-8
    SOAPAction: "urn:zimbraAdmin#AuthRequest"
    
    <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding" xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><context xmlns="urn:zimbraAdmin" /></soap:Header><soap:Body><AuthRequest xmlns="urn:zimbraAdmin"><name xsi:type="xsd:string">zimbra</name><password xsi:type="xsd:string">******</password></AuthRequest></soap:Body></soap:Envelope>
    SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
    Connection: close
    Date: Tue, 23 Oct 2007 20:38:22 GMT
    Server: Apache-Coyote/1.1
    Content-Length: 603
    Content-Type: text/xml;charset=utf-8
    Client-Date: Tue, 23 Oct 2007 20:40:06 GMT
    Client-Peer: 172.17.34.158:7071
    Client-Response-Num: 1
    Client-SSL-Cert-Issuer: /C=US/ST=NA/L=NA/O=Zimbra/OU=Zimbra/CN=zimbra.uhd.edu
    Client-SSL-Cert-Subject: /C=US/ST=NA/L=NA/O=Zimbra/OU=Zimbra/CN=zimbra.uhd.edu
    Client-SSL-Cipher: EDH-RSA-DES-CBC3-SHA
    Client-SSL-Warning: Peer certificate not verified
    
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><context xmlns="urn:zimbra"><sessionId type="admin" id="23">23</sessionId></context></soap:Header><soap:Body><AuthResponse xmlns="urn:zimbraAdmin"><authToken>0_0ad721a82406c9ff86da8ae112f243258c5d3cf7_69643d33363a65306661666438392d313336302d313164392d383636312d3030306139356439386566323b6578703d31333a313139333231353130323034333b61646d696e3d313a313b</authToken><lifetime>43200000</lifetime><a n="zimbraIsDomainAdminAccount">false</a><sessionId type="admin" id="23">23</sessionId></AuthResponse></soap:Body></soap:Envelope>
    
    OUTPUT ON THE SCREEN FROM MY PERL SCRIPT: 
    Token: "0_0ad721a82406c9ff86da8ae112f243258c5d3cf7_69643d33363a65306661666438392d313336302d313164392d383636312d3030306139356439386566323b6578703d31333a313139333231353130323034333b61646d696e3d313a313b"
    For UserID: "23" 
    
    SOAP::Transport::HTTP::Client::send_receive: POST https://thenameofmyhost.domainname:7071/service/admin/soap/ HTTP/1.1
    Accept: text/xml
    Accept: multipart/*
    Accept: application/soap
    User-Agent: SOAP::Lite/Perl/0.69
    Content-Length: 1009
    Content-Type: application/soap; charset=utf-8
    SOAPAction: "urn:zimbraAdmin#CreateAccountRequest"
    
    <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding" xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><context xmlns="urn:zimbra" /><authToken xsi:type="xsd:string">0_0ad721a82406c9ff86da8ae112f243258c5d3cf7_69643d33363a65306661666438392d313336302d313164392d383636312d3030306139356439386566323b6578703d31333a313139333231353130323034333b61646d696e3d313a313b</authToken><sessionId xsi:type="xsd:int" id="23">23</sessionId></soap:Header><soap:Body><CreateAccountRequest xmlns="urn:zimbraAdmin"><name xsi:type="xsd:string">apellidoe@thenameofmyhost.domainname</name><password /><a n="sn" xsi:type="xsd:string">Apellido</a><a n="givenName" xsi:type="xsd:string">Estudiante</a><a n="displayName" xsi:type="xsd:string">Estudiante Apellido</a></CreateAccountRequest></soap:Body></soap:Envelope>
    SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
    Connection: close
    Date: Tue, 23 Oct 2007 20:38:22 GMT
    Server: Apache-Coyote/1.1
    Content-Length: 2282
    Content-Type: text/xml;charset=utf-8
    Client-Date: Tue, 23 Oct 2007 20:40:06 GMT
    Client-Peer: 172.17.34.158:7071
    Client-Response-Num: 1
    Client-SSL-Cert-Issuer: /C=US/ST=NA/L=NA/O=Zimbra/OU=Zimbra/CN=zimbra.uhd.edu
    Client-SSL-Cert-Subject: /C=US/ST=NA/L=NA/O=Zimbra/OU=Zimbra/CN=zimbra.uhd.edu
    Client-SSL-Cipher: EDH-RSA-DES-CBC3-SHA
    Client-SSL-Warning: Peer certificate not verified
    
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Sender</soap:Value></soap:Code><soap:Reason><soap:Text>no valid authtoken present</soap:Text></soap:Reason><soap:Detail><Error xmlns="urn:zimbra"><Code>service.AUTH_REQUIRED</Code><Trace>com.zimbra.common.service.ServiceException: no valid authtoken present
            at com.zimbra.common.service.ServiceException.AUTH_REQUIRED(ServiceException.java:213)
            at com.zimbra.soap.SoapEngine.dispatchRequest(SoapEngine.java:237)
            at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:168)
            at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:90)
            at com.zimbra.soap.SoapServlet.doPost(SoapServlet.java:223)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
            at com.zimbra.cs.servlet.ZimbraServlet.service(ZimbraServlet.java:162)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:595)
    </Trace></Error></soap:Detail></soap:Fault></soap:Body></soap:Envelope>
    ERROR: $VAR1 = {
              'Detail' => {
                          'Error' => {
                                     'Code' => 'service.AUTH_REQUIRED',
                                     'Trace' => 'com.zimbra.common.service.ServiceException: no valid authtoken present
            at com.zimbra.common.service.ServiceException.AUTH_REQUIRED(ServiceException.java:213)
            at com.zimbra.soap.SoapEngine.dispatchRequest(SoapEngine.java:237)
            at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:168)
            at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:90)
            at com.zimbra.soap.SoapServlet.doPost(SoapServlet.java:223)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
            at com.zimbra.cs.servlet.ZimbraServlet.service(ZimbraServlet.java:162)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:595)
    '
                                   }
                        },
              'Reason' => {
                          'Text' => 'no valid authtoken present'
                        },
              'Code' => {
                        'Value' => 'soap:Sender'
                      }
            };
    By the looks of my request and my responses on the status (using DEBUG to view on standard output), what could I be doing wrong?

    Thanks in advance.

    (first post)
    Does the session id need to be in the zimbra name space?

    That's the only thing that jumped out at me.

  3. #3
    almanzam is offline New Member
    Join Date
    Aug 2007
    Posts
    4
    Rep Power
    7

    Default

    I had a response from someone over at ZIMBRA, and they pointed out that my code didn't have AuthToken within <CONTEXT>.

    I hadn't closed up <CONTEXT>, and it was causing AuthToken to be outside of it. The Context needed the SessionID and the AuthToken together, and I didn't have that.

    That solved it.

    Thank you, ZIMBRA dudes.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problem with SOAP CreateAccountRequest
    By rtanner in forum Administrators
    Replies: 1
    Last Post: 04-21-2006, 06:18 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
  •