diff --git a/components/http_client.rst b/components/http_client.rst index 06c0ad246d1..9a567f3c3bc 100644 --- a/components/http_client.rst +++ b/components/http_client.rst @@ -130,14 +130,18 @@ each request (which overrides any global authentication):: // Use the same authentication for all requests $httpClient = HttpClient::create([ - // HTTP Basic authentication with only the username and not a password + // HTTP Basic authentication (there are multiple ways of configuring it) 'auth_basic' => ['the-username'], - - // HTTP Basic authentication with a username and a password 'auth_basic' => ['the-username', 'the-password'], + 'auth_basic' => 'the-username:the-password', // HTTP Bearer authentication (also called token authentication) 'auth_bearer' => 'the-bearer-token', + + // Microsoft NTLM authentication (there are multiple ways of configuring it) + 'auth_ntlm' => ['the-username'], + 'auth_ntlm' => ['the-username', 'the-password'], + 'auth_ntlm' => 'the-username:the-password', ]); $response = $httpClient->request('GET', 'https://...', [ @@ -147,6 +151,14 @@ each request (which overrides any global authentication):: // ... ]); +.. note:: + + The NTLM authentication mechanism requires using the cURL transport. + +.. versionadded:: 4.4 + + The ``auth_ntlm`` option was introduced in Symfony 4.4. + Query String Parameters ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index d280fe4d97b..4980613d440 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -116,6 +116,7 @@ Configuration * `scope`_ * `auth_basic`_ * `auth_bearer`_ + * `auth_ntlm`_ * `base_uri`_ * `bindto`_ * `cafile`_ @@ -747,6 +748,20 @@ auth_bearer The token used to create the ``Authorization`` HTTP header used in HTTP Bearer authentication (also called token authentication). +auth_ntlm +......... + +**type**: ``string`` + +.. versionadded:: 4.3 + + The ``auth_ntlm`` option was introduced in Symfony 4.4. + +The username and password used to create the ``Authorization`` HTTP header used +in the `Microsoft NTLM authentication protocol`_. The value of this option must +follow the format ``username:password``. This authentication mechanism requires +using the CURL-based transport. + base_uri ........ @@ -2776,3 +2791,4 @@ to know their differences. .. _`default_socket_timeout`: https://php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout .. _`PEM formatted`: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail .. _`haveibeenpwned.com`: https://haveibeenpwned.com/ +.. _`Microsoft NTLM authentication protocol`: https://docs.microsoft.com/en-us/windows/desktop/secauthn/microsoft-ntlm