OData Authentication with Curl for Dynamics Nav

I am trying to use Curl to pull some data from Microsoft Dynamics Nav.

I can easily access it through my browser at this URL: http://kevans:(password)@192.168.0.30:8048/Sandbox/OData/and it works great.

In Curl I tried this: curl --ntlm -u kevans "http://192.168.0.30:8048/Sandbox/OData/" -venter my password at the prompt, but it will return 401 Unauthorized error.

Is there anything that needs to be done to make it accessible to Curl?

Here's the output of Curl:

curl --ntlm -u kevans "http://192.168.0.30:8048/Sandbox/OData/" -v
Enter host password for user 'kevans':
* About to connect() to 192.168.0.30 port 8048 (#0)
*   Trying 192.168.0.30...
* Adding handle: conn: 0x525fe0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x525fe0) send_pipe: 1, recv_pipe: 0
* Connected to 192.168.0.30 (192.168.0.30) port 8048 (#0)
* Server auth using NTLM with user 'kevans'
> GET /Sandbox/OData/ HTTP/1.1
> Authorization: NTLM TlRMTVNTUAABAAAAt4II4gAAAAAAAAAAAAAAAAAAAAAGA4AlAAAADw==
> User-Agent: curl/7.33.0
> Host: 192.168.0.30:8048
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Content-Length: 0
* Server Microsoft-HTTPAPI/2.0 is not blacklisted
< Server: Microsoft-HTTPAPI/2.0
< WWW-Authenticate: Negotiate
< Date: Thu, 05 Feb 2015 20:25:26 GMT
<
* Connection #0 to host 192.168.0.30 left intact

Things I tried:

  • using argument --negotiatealong with--ntlm
  • using --anyauth
  • using my domain -u MYDOMAIN\kevans
  • using -u MYDOMAIN\kevans:passwordand-u kevans:password
+4
source share
2 answers

Curl 7.33 7.40, . , . , , .

+2

, . , - .

  • MMC- Microsoft Dynamics Nav Server
  • NAV
  • "" ,
  • / " NTLM"
  • .
  • NAV

CURL HTTP Response "WWW-Authenticate: Negotiate" "WWW-Authenticate: NTLM", :

curl -v --ntlm -u 'username:password' "http://YOUR_NAV_URL:8048/NAV_INSTANCE_NAME/OData/" 
+2

All Articles