feat(esp_http_client): SHA256 support in digest auth

Added support for using SHA256 algorithm while calculating
digest auth in HTTP client connection

Closes https://github.com/espressif/esp-idf/issues/12383
This commit is contained in:
Harshit Malpani
2023-10-19 18:27:08 +05:30
parent 5ec9f498bc
commit 803ad150cf
5 changed files with 119 additions and 20 deletions

View File

@@ -83,6 +83,7 @@ ESP HTTP client supports both **Basic** and **Digest** Authentication.
* Users can provide the username and password in the ``url`` or the ``username`` and ``password`` members of the ``esp_http_client_config_t`` configuration. For ``auth_type = HTTP_AUTH_TYPE_BASIC``, the HTTP client takes only one perform operation to pass the authentication process.
* If ``auth_type = HTTP_AUTH_TYPE_NONE``, but the ``username`` and ``password`` fields are present in the configuration, the HTTP client takes two perform operations. The client will receive the ``401 Unauthorized`` header in its first attempt to connect to the server. Based on this information, it decides which authentication method to choose and performs it in the second operation.
* Check out the example functions ``http_auth_basic``, ``http_auth_basic_redirect`` (for Basic authentication) and ``http_auth_digest`` (for Digest authentication) in the application example for implementation details.
* Currently, only MD5 and SHA-256 algorithms are supported with Digest authentication.
Examples of Authentication Configuration