Skip to content

Commit 084e6b2

Browse files
committed
[HttpClient] Documented the auth_ntlm option
1 parent 9597f82 commit 084e6b2

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

components/http_client.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,18 @@ each request (which overrides any global authentication)::
130130

131131
// Use the same authentication for all requests
132132
$httpClient = HttpClient::create([
133-
// HTTP Basic authentication with only the username and not a password
133+
// HTTP Basic authentication (there are multiple ways of configuring it)
134134
'auth_basic' => ['the-username'],
135-
136-
// HTTP Basic authentication with a username and a password
137135
'auth_basic' => ['the-username', 'the-password'],
136+
'auth_basic' => 'the-username:the-password',
138137

139138
// HTTP Bearer authentication (also called token authentication)
140139
'auth_bearer' => 'the-bearer-token',
140+
141+
// Microsoft NTLM authentication (there are multiple ways of configuring it)
142+
'auth_ntlm' => ['the-username'],
143+
'auth_ntlm' => ['the-username', 'the-password'],
144+
'auth_ntlm' => 'the-username:the-password',
141145
]);
142146

143147
$response = $httpClient->request('GET', 'https://...', [
@@ -147,6 +151,14 @@ each request (which overrides any global authentication)::
147151
// ...
148152
]);
149153

154+
.. note::
155+
156+
The NTLM authentication mechanism requires using the cURL transport.
157+
158+
.. versionadded:: 4.4
159+
160+
The ``auth_ntlm`` option was introduced in Symfony 4.4.
161+
150162
Query String Parameters
151163
~~~~~~~~~~~~~~~~~~~~~~~
152164

reference/configuration/framework.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ Configuration
116116
* `scope`_
117117
* `auth_basic`_
118118
* `auth_bearer`_
119+
* `auth_ntlm`_
119120
* `base_uri`_
120121
* `bindto`_
121122
* `cafile`_
@@ -747,6 +748,20 @@ auth_bearer
747748
The token used to create the ``Authorization`` HTTP header used in HTTP Bearer
748749
authentication (also called token authentication).
749750

751+
auth_ntlm
752+
.........
753+
754+
**type**: ``string``
755+
756+
.. versionadded:: 4.3
757+
758+
The ``auth_ntlm`` option was introduced in Symfony 4.4.
759+
760+
The username and password used to create the ``Authorization`` HTTP header used
761+
in the `Microsoft NTLM authentication protocol`_. The value of this option must
762+
follow the format ``username:password``. This authentication mechanism requires
763+
using the CURL-based transport.
764+
750765
base_uri
751766
........
752767

@@ -2776,3 +2791,4 @@ to know their differences.
27762791
.. _`default_socket_timeout`: https://php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout
27772792
.. _`PEM formatted`: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail
27782793
.. _`haveibeenpwned.com`: https://haveibeenpwned.com/
2794+
.. _`Microsoft NTLM authentication protocol`: https://docs.microsoft.com/en-us/windows/desktop/secauthn/microsoft-ntlm

0 commit comments

Comments
 (0)