-
Notifications
You must be signed in to change notification settings - Fork 9
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
httpd authentication_handlers #6
Comments
I do not think so, because BrowserID is simply the process of creating normal users (documents in the |
but does that not count for {couch_httpd_oauth, oauth_authentication_handler} as well? |
Yes. Great point. I think the next problem is that the plugins is more than just an authentication handler, it also creates new accounts (autovivification) once they authenticate for the first time, since every possible email address is a valid account. You have definitely persuaded me that an authentication module/config would be more standard. But what to do about requests to /_browserid to use its API? I definitely wanted this to be disabled by default. People probably do not want automatic account creation unless they explicitly ask for that. (There is also a denial of service vulnerability. An attacker could create a user document for unlimited addresses at some domain, such as mailinator.com, until the CouchDB server fills up its disk.) Thoughts? Thanks! |
Maybe create two types? one for authentication only one for new user registration Only the browser id service provider (https://browserid.org/verify) should be able to request a create account right? So the security about the denial of service is there responsibility. |
Well, another wrinkle is that the service provider is supposed to be a stopgap, CouchDB should really be confirming ids on its own but that requires more programming than I can allocate at this time (some crypto code at least, plus a deeper understanding of the BrowserID spec, plus possibly things like sending emails, I'm not sure.) So, at this time, it's a trade-off, and by using this plugin (and most others at this time, I presume), you are trusting Mozilla to have a correct implementation, and to maintain the integrity and security of their web service. Although I can't justify putting off work just because there is more work to be done later :) |
Back to the pressing matter: Does your idea of the two types change how CouchDB developers (I mean, people using CouchDB to build apps) would use it? One thing I am very proud and excited about with BrowserID is that it is actually the easiest user and authentication system to get going, partially by design, but also because of the reference implementation I included in /_browserid/*.html, *.js, etc. So, is there a way to improve the inner architecture while still maintaining (or improving!) simplicity from the developer's perspective? |
The inner architecture should be transparent to the authentication method. If I would create a new _user directly into couchdb using curl -X PUT, the new created user should be able to login by all enabled authentication handlers in the config. All existing users should be able to log in also without changing there _user document. "browserid": true in a _user document is not a good idea, there should be no difference between a normal _user and a browserid _user. Any couchdb should be able to switch browserid on and off for all users by simple defining {couch_httpd_browserid, browserid_authentication_handler} in the config. Not by enabling it and then change a few million _user records with the authentication flavor of the day. |
"browserid":true is not used by any code, I merely put it there to annoy you :) But seriously, it doesn't do anything. I just thought it might be helpful for example if you and I share user accounts from people who use BrowserID. I can replicate from your You are 100% correct that every user should be able to authenticate in any way. If the browserid plugin breaks that, that is definitely a bug. People routinely authenticate with either HTTP basic auth, or else a username/password form submission, but subsequent queries are authenticated via a cookie. I am starting to see a solution to the problem you identify. Cookie authentication is triggered via form submission to the /_session URL. It seems like BrowserID belongs there. So, basically, if you submit Does that sound right to you? I think that is starting to sound like correct architecture. (The next question is whether it can be done as a third-party plugin. The reason I added a |
/_session would be ideal but /_browserid is acceptable like /_oauth or /_fb is. Its the fiddling with _users documents that should be 1) NOT recommended 2) a extra option like obscuring email addresses. |
Suppose https://browserid.org shuts down then the plugin could offer to send you a generated password to your email (_id) so you are able to login using the default handlers. |
Is it possible to make a handler in the config like this instead of browserid enabled true?
httpd authentication_handlers
{couch_httpd_oauth, oauth_authentication_handler}, {couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler},{couch_httpd_browserid, browserid_authentication_handler}
The text was updated successfully, but these errors were encountered: