1

I am trying to connect to servicenow server with curl which uses ldap authentication.

my command:

curl -ntlm -u user https://my.service-now.com/api/now/table/incident

Then I got:

Enter host password for user 'user':
{"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"}

How can I get authentication by curl command?

Roman Kaganovich
  • 618
  • 2
  • 6
  • 27

1 Answers1

3

You can try this to authenticate:

curl -ntlm "https://my.service-now.com/api/now/table/incident" --user 'user':'user_password'

Replace with your user Id and password to execute it

Josh Correia
  • 3,807
  • 3
  • 33
  • 50
Alikutty K
  • 146
  • 3
  • Tried to run the example with additional flag: --header > curl -ntlm "https://my.service-now.com/api/now/table/incident" --user 'user':'pass'--header "Accept:application/json" {"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"} but still get the same error – Roman Kaganovich Jan 23 '19 at 07:07
  • Did you check if user and pass are valid in Service Now by logging into your instance. Try it out here https://my.service-now.com/login.do – Alikutty K Jan 23 '19 at 08:32
  • You are right - I cannot login from my.service-now.com/login.do address, but I can login in https://my.service-now.com/sp – Roman Kaganovich Jan 23 '19 at 09:11
  • 1
    It should work from login.do to access the API. You need to set a back-end password for your ID and then try it. Only SN administrators can do it from the user profile – Alikutty K Jan 24 '19 at 11:12