You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to implement some stuff of CloudApp API but I wasn't able to implement the Basic authentication, according to the documentation I just need to specify in the request config the auth parameters, like this
Is this being run in Node or in the browser? Have you inspected the request in the developer tools? What is being send? Have you seen any error in the console?
Digest authentication would be great. +1 from me as well.
Reacted by Arian Valdez, Christoph, Nick Schaubeck, chiorio, Hao Tang, Daniel Skogly, Aowss Ibrahim, owlran, Christian, Jakub Jemieljańczuk and 11 more
It computes the right headers involved in the Digest algo as defined in the RFC.
Feel free to reuse the code. I do not know the code base of Axios, nor the dev process, but if someone is ready to assist me just the minimum on that front, I'd be happy to provide a PR.
Admittedly HTTP Digest Auth is a bit anachronistic, I hadn't seen anyone use it since the 90's until I started looking into how to figure out Atlas' API. But once you figure out how to calculate the digest you can just stick it in the auth header and you're good. I'll probably wrap this in an error interceptor in my own code.
@determin1st Sorry, I didn't see your message before. The function requestAuth in that code is quite self-contained. It makes a request, and as long as the response is 401 (max 3 times), it computes the Authorization header based on the WWW-Authenticate header.
If you can drive me through the Axios code base, I would be happy to assist you on that part.
Activity
rubennorte commentedon Feb 12, 2017
Is this being run in Node or in the browser? Have you inspected the request in the developer tools? What is being send? Have you seen any error in the console?
nickuraltsev commentedon Mar 2, 2017
Closing due to inactivity. Please feel free to reopen.
buccfer commentedon Sep 13, 2017
@nickuraltsev With
sendImmediately: falsein request library you can perform a digest auth. Is there any way to achieve the same with axios?. Thanks.shtse8 commentedon Nov 23, 2017
any updates? I want to do digest auth, but it seems axios cannot support it.
https://github.com/request/request/blob/b12a6245d9acdb1e13c6486d427801e123fdafae/lib/auth.js#L50
emilian commentedon Mar 1, 2018
Digest authentication would be great. +1 from me as well.
chukitow commentedon Mar 1, 2018
@rubennorte I was trying to run the script in node
actionnick commentedon Jul 17, 2018
https://en.wikipedia.org/wiki/Digest_access_authentication
This should probably work.
ashavk commentedon Feb 23, 2019
Is there any conclusion/update on the same? Still can't find a way to perform digest auth using axios.
tjunussov commentedon Mar 13, 2019
ronkorving commentedon May 9, 2019
Need! :'(
Please re-open, this is such a core feature of an HTTP library...
rmnaderdev commentedon May 17, 2019
Need!
falcaosurfline-zz commentedon May 29, 2019
+1 . ... this would be something really nice to have handy
alirezamirsepassi commentedon Jun 22, 2019
Please reopen!!
rakeshta commentedon Sep 16, 2019
+1 vote for digest authentication.
falling back to Basic auth for now (sigh)
bernhardberger commentedon Sep 28, 2019
Agreed.. +1
ronkorving commentedon Sep 30, 2019
@chukitow @nickuraltsev I can't reopen, but someone who can, please do?
fgeorges commentedon Nov 28, 2019
Digest authentication is a core feature of an HTTP client. In case this can help, I implemented it in the function
requestAuthat https://github.com/fgeorges/mlproj/blob/master/src/node.js.It computes the right headers involved in the Digest algo as defined in the RFC.
Feel free to reuse the code. I do not know the code base of Axios, nor the dev process, but if someone is ready to assist me just the minimum on that front, I'd be happy to provide a PR.
chrisdchristo commentedon Mar 2, 2020
+1 Needed to access things like the MongoDB Atlas API, which uses Digest Authentication only.
UPDATE, so I tried working with both https://github.com/rearn/axios-digest and https://github.com/slip91/axios-digest-v2 as an addon library to axios, but neither worked.
So I settled on using https://github.com/node-fetch/node-fetch with https://github.com/devfans/digest-fetch which worked.
determin1st commentedon Mar 3, 2020
@fgeorges can you provide more info, i may try to integrate your code into my lib
CadsoftBrianW commentedon Mar 19, 2020
@chrisdchristo I have the same use case, not sure how to proceed.
chrisdchristo commentedon Mar 19, 2020
@CadsoftBrianW see my updated comment above on how to do digest with MongoDB Atlas.
vkarpov15 commentedon Apr 8, 2020
I wrote a quick implementation of digest auth to make requests to MongoDB Atlas' API, hopefully this helps someone:
Admittedly HTTP Digest Auth is a bit anachronistic, I hadn't seen anyone use it since the 90's until I started looking into how to figure out Atlas' API. But once you figure out how to calculate the digest you can just stick it in the auth header and you're good. I'll probably wrap this in an error interceptor in my own code.
fgeorges commentedon Apr 9, 2020
@determin1st Sorry, I didn't see your message before. The function
requestAuthin that code is quite self-contained. It makes a request, and as long as the response is 401 (max 3 times), it computes theAuthorizationheader based on theWWW-Authenticateheader.If you can drive me through the Axios code base, I would be happy to assist you on that part.