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

Add option to accept empty password in BasicStrategy #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jeanfw
Copy link

@jeanfw jeanfw commented Apr 15, 2014

Accept empty passwords (i.e. userid: instead of userid:password) by passing a new option, { acceptEmptyPassword: true }, when creating the strategy.

This is useful for implementing an API that only requires a secret key as the username (example: Stripe's API authentication). Instead of failing with a 400 Bad Request, Passport will now let the verify callback decide how to handle the empty password.

The IETF spec wasn't clear for me on whether an empty password is allowed or not, so when the option is not explicitly set to true I kept the previous behavior (400).

Would be happy to make this the default and remove the option though, if there are no side effects I'm not seeing :)

@niftylettuce
Copy link

@jeanfw thanks for this!

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 this pull request may close these issues.

None yet

2 participants