asyrjasalo / RESTinstance

Robot Framework library for RESTful JSON APIs
https://pypi.org/project/RESTinstance
GNU Lesser General Public License v3.0
206 stars 84 forks source link

No Basic authentication option? #11

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi, I dig into to the documentation and source code and I don't see any option to do basic authentication like this:

http://docs.python-requests.org/en/master/user/authentication/#basic-authentication

Thanks!

P.S: At the present time I put the credentials in the Library REST import like this: Library REST http://${USER}:{PASS}@${URL}:${PORT}

asyrjasalo commented 6 years ago

Using keyword Set Headers to set header Authorization: Basic <token> should be enough, and is, in my opinion, simpler than having e.g. a keyword in the library for this (this behaviour can be done easily as an user keyword anyway).

Alternatively, one can set the authentication credentials as part of the URL, as in the above example.

(Edit: fix a typo with missing "in" word)

ghost commented 6 years ago

I knew about the basic authorization in the header but I had feedback from a dev that wanted to provide user/pass in a keyword like you mentionned. Thanks for the confirmation!