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

Basic auth without both username and password #502

Closed
tlsa opened this issue Aug 14, 2018 · 2 comments · May be fixed by #503
Closed

Basic auth without both username and password #502

tlsa opened this issue Aug 14, 2018 · 2 comments · May be fixed by #503

Comments

@tlsa
Copy link

tlsa commented Aug 14, 2018

https://httpbin.org/basic-auth/foo/bar works for testing basic auth with a username and a password.

However, all of the following give 404 not found errors:

Is there a way to test these features of basic auth with httpbin?

@javabrett
Copy link
Contributor

javabrett commented Aug 15, 2018

httpbin now uses Swagger/OpenAPI for endpoints, and path-positional args are mandatory. It would be possible to allow a test for user=foo, passwd="", but empty username seems more problematic. Do you really need that?

So one option is to create a second endpoint which tasks only /user and passwd is then "". Would that do it? Won't allow empty username, but a username of " " could be sent as /basic-auth/%20.

Otherwise I think url-query-string parameters will be required.

@tlsa
Copy link
Author

tlsa commented Aug 15, 2018

@javabrett Wow, thanks for the quick fix.

How often is httpbin.org updated? https://httpbin.org/basic-auth/foo doesn't currently work for testing with username and no password.

username seems more problematic. Do you really need that?

My use case is that I develop a web browser (NetSurf), and have just been reworking the handling of basic-auth. So I wanted, for testing purposes, some server that I could control the required access credentials for. I particularly want to test the edge cases, and check that NetSurf behaves the same as mainstream browsers.

https://tools.ietf.org/html/rfc7617#section-2 just says that the user-id string is concatenated with the ':' character and then with the password string. Either or both of the user-id and password string may be the empty string, "". So it would be neat to be able to test that somehow.

I've also asked on our mailing list for users to test, and mentioned httpbin: https://www.mail-archive.com/[email protected]/msg07539.html

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

Successfully merging a pull request may close this issue.

2 participants