Support for the HTTP Digest authentication on MicroPython (requests and/or aiohttp) #15138
Replies: 2 comments
-
Digest authentication is done using the Authorization header. Both request and aiohttp allow to specify that from the outside. So you do not need to pick a library, nor does this need to happen inside the library. You just need to have code that crafts the correctly formatted header |
Beta Was this translation helpful? Give feedback.
-
Is the question still valid? I had the same problem. Here is my solution. It connects with 2 pieces of However, there are different variants of HTTP Digest authentication. You might need to adapt my solution to your variant. Source code for other variants can be taken from here: https://github.com/psf/requests/blob/main/src/requests/auth.py Good look! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all!
I need to communicate with some products that have an API that support only
HTTP Digest authentication
, I mean, they do not supportHTTP Basic authentication
and it is not possible to disable the authentication.I see that MicroPython has two HTTP client libs that can be used for that purpose:
requests
(https://github.com/micropython/micropython-lib/tree/master/python-ecosys/requests) - It issync
, and supportHTTP Basic authentication
, but does not supportHTTP Digest authentication
aiohttp
(https://github.com/micropython/micropython-lib/tree/master/python-ecosys/aiohttp/aiohttp) - It isasync
, and does not supportHTTP Basic authentication
and does not supportHTTP Digest authentication
as well.I see there is this uwwwauth.py -> https://github.com/pfalcon/pycopy-lib/blob/master/uwwwauth/uwwwauth.py that is a support for
HTTP Digest authentication
for the pycopy (It seems to be like as old fork of MicroPython). Can that help to supportHTTP Digest authentication
on therequests
and/oraiohttp
clients?Is it a simple or difficult task to support
HTTP Digest authentication
on the MicroPythonrequests
/aiohttp
? If I were to choose just one that http client libs to be supported by theHTTP Digest authentication
, I would like to be theaiohttp
because it is async (asyncio), so I do not need to use threads to have a non blocking code.Thank you!
Beta Was this translation helpful? Give feedback.
All reactions