Skip to content

[HttpClient] Documented the auth_ntlm option #11876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions components/http_client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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://...', [
Expand All @@ -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
~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
16 changes: 16 additions & 0 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ Configuration
* `scope`_
* `auth_basic`_
* `auth_bearer`_
* `auth_ntlm`_
* `base_uri`_
* `bindto`_
* `cafile`_
Expand Down Expand Up @@ -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
........

Expand Down Expand Up @@ -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