surf icon indicating copy to clipboard operation
surf copied to clipboard

AddRequestHeader not working

Open anisbhsl opened this issue 4 years ago • 3 comments

I am trying to do basic auth using authorization header. However, during URL request surf is not attaching the header with the request. I did following:

browser.AddRequestHeader("Authorization","Basic "+base64encodedstring)
browser.Open(url)
browser.StatusCode() //throwing 401 

anisbhsl avatar Apr 17 '20 09:04 anisbhsl

@headzoo Could you provide some insight? How could we login into a website requesting basic auth?

@anisbhsl Did you manage to figure it out?

s0kil avatar Oct 07 '21 16:10 s0kil

@s0kil I had to make custom changes in this library to make it work. You need to intercept the request maker (though need to hardcode authorization token there), but I managed to solve it that way.

anisbhsl avatar Oct 08 '21 21:10 anisbhsl

My problem was that I was trying to use basic auth to login, but the server wants digest authentication.

s0kil avatar Oct 08 '21 21:10 s0kil