Curl 401 unauthorized

I am trying to run a simple curl restAPI call with Domain authentication but its throwing error 401 unauthorized.

I am following below method

curl.exe --insecure --ntlm --user 'SvcAcct-ABC@My.com':'avxds24' -X POST https://abcserver:52311/api/.....
HTTP 401: Unauthorized

However same method is working if I am using local ID & removing –ntlm

Just FYI there is no issue with mentioned service ID, I am able to do browser based API call & able to get desired info. Its just not working with curl may be I am not using correct method but I am not able to find anything useful for running cURL with BigFix LDAP operator ID.

I’m actually not sure whether the server supports ntlm auth. Given the server can run on Windows or Red Hat, I don’t see any reason it should…when selecting “Use Windows Credentials” for the Console, it’s a Kerberos authentication.

I’m also not sure about curl’s ntlm support, but…if it was doing ntlm in the first place, you wouldn’t need to supply username and password.

Try using curl without the ntlm options.

1 Like