Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentification doesn't work if auth_username/auth_password are empty strings #286

Open
sebastiendarocha opened this issue Aug 11, 2018 · 0 comments

Comments

@sebastiendarocha
Copy link

- test:
  - name: "Anonymous access to open data"
  - url: "/authenticated_realm"
  - auth_username: ""
  - auth_password: ""

This is what happens when you click "OK" on your navigator authentication popup for basic auth without giving credentials.

Pyresttest is meant to send an authorization header with "Basic Og==" (it's ":" base64 encoded). But it doesn't send any authorization header.

You can test it (getting the header) by visiting http://httpstat.us/401 with your navigator and seeing the headers of the requests when you click OK.

I've temporarily fixed this by replacing this line:

if self.auth_username and self.auth_password:

by:

        if self.auth_username  is not None and self.auth_password is not None:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant