jamesiarmes / php-ntlm

NTLM authentication library for PHP.
MIT License
54 stars 27 forks source link

EWS returns 401 when using CURLAUTH_BASIC | CURLAUTH_NTLM, but works with CURLAUTH_NTLM #5

Closed arkuuu closed 6 years ago

arkuuu commented 6 years ago

Hello,

An Exchange server I'm trying to connect to gives me a 401 response.

When I change the line https://github.com/jamesiarmes/php-ntlm/blob/master/src/SoapClient.php#L196

CURLOPT_HTTPAUTH => CURLAUTH_BASIC | CURLAUTH_NTLM,

to

CURLOPT_HTTPAUTH => CURLAUTH_NTLM,

it works without any problems.

Does anyone have an idea why it works only with CURLAUTH_NTLM, but not with both?

jamesiarmes commented 6 years ago

While I can't tell you exactly why this happens, some Exchange servers only support one of the httpauth options rather than both. You can override the default by setting "curlopts" in the options passed to the constructor.

arkuuu commented 6 years ago

So, it depends on the server, ok. Thank you!