0
votes

We are trying to connect to Apache server from MarkLogic using digest authentication. However, we are getting 401 unauthorized error while trying to connect. Below is the MarkLogic API we are using:

xdmp:http-get("htp://localhost:port/a/b/c",
 <options xmlns="xdmp:http">
   <authentication method="digest">
     <username>abc</username>
     <password>abc123</password>
   </authentication>
  </options>)

And the response we are getting is below. Could you tell me what could be the issue here?

<response>
<code>401</code>
<message>Unauthorized</message>
<headers>
  <server>Apache-Coyote/1.1</server>
  <www-authenticate>Digest realm="ABCRealm", qop="auth",  nonce="MTM3ODg4ODk3MjY5NTplMGFiYWI1YmZiNmM4YzU0OWJmMWM2ZWU5ZTYwODcxOQ=="</www-authenticate>
  <content-type>text/html;charset=utf-8</content-type>
  <content-length>1041</content-length>
  <date>Wed, 11 Sep 2013 08:37:52 IST</date>
  <cache-control>proxy-revalidate</cache-control>
  <connection>close</connection>
 </headers>
</response>

HTTP Status 401 - Nonce should have yielded two tokens but was

Regards, Vijay

1
What is this incomplete sentence supposed to mean? "HTTP Status 401 - Nonce should have yielded two tokens but was ". - mblakele
It is a part of the response.. Sorry for not posting the complete response in my earlier post.. Below is the second part of response I got from xdmp:http-get.. <html><head><title>Apache Tomcat/7.0.32 - Error report</title> </head><body><h1>HTTP Status 401 - Nonce should have yielded two tokens but was </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Nonce should have yielded two tokens but was </u></p><p><b>description</b> <u>This request requires HTTP authentication.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.32</h3></body></html> - user2767831
Is the line Module digest_module mod_digest.o commented-out in your config file? - s3-4v

1 Answers

0
votes

I know this not really an answer, but whenever I've had issues getting MarkLogic to play well with REST or SOAP I've start it in soapUI first and made sure it was working or wasn't something to do with my input. If you get it working in soapUI you can take the input that it has and put into xdmp:http-get.