Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't cURL work with Windows Authentication on IIS7?

I am trying to access a service that is behind Windows Authentication. I thought I could pass the credentials the way HTTP Basic Authentication credentials are passed, but it's not working. When I do the following, I get a 401 error, and I am absolutely sure the password is correct.

curl --user username:password http://example.com 

Why doesn't this work?

like image 547
woz Avatar asked Aug 23 '12 14:08

woz


People also ask

How do you use curl command with authentication?

To use basic authentication, use the cURL --user option followed by your company name and user name as the value. cURL will then prompt you for your password.

Does Kestrel support Windows Authentication?

Authentication. Negotiate NuGet package can be used with Kestrel to support Windows Authentication using Negotiate and Kerberos on Windows, Linux, and macOS. Credentials can be persisted across requests on a connection.

How do I enable Windows integrated authentication?

Open the Windows Control Panel and go to Network and Internet > Internet Options. On the Advanced tab, select Enable Integrated Windows Authentication.

How does Windows Authentication work in IIS?

Authentication: The client generates and hashes a response and sends it to the IIS server. The server receives the challenge-hashed response and compares it to what it knows to be the appropriate response. If the received response matches the expected response, the user is successfully authenticated to the server.


1 Answers

If you are using Windows Authentication, you need to use NTLM:

curl --ntlm --user username:password http://example.com 
like image 70
woz Avatar answered Sep 30 '22 19:09

woz