On Jul 1, 10:47 pm, Kyle Finley wrote:
> I would like to begin work on adding mutil-auth to webapp2.
>
> My immediate need is for username/email and password, so that's were I would
> like to begin. Did you have a particular implementation in mind? Are you
> happy with tipfy's User model and middleware, or would you prefer webapp2
> takes a different approach?
I have a draft and partial implementation for a simplified API. I have
to take a better look at it then will let you know if it is worth.
webapp2 doesn't use handler middleware like in tipfy. Not by default;
it is simple to implement but it is left to users. See in the session
API docs that there's a kind of 'handler middleware' in the example,
set directly in dispatch() where sessions are saved. It's do-it-
yourself. The idea for an auth module would be to provide helpers for
authentication but be more diy.
> In the previous thread you stated that you would like to use external
> libraries for oauth and openid. Are there any example project (maybe in
> django) that you could point me to that have a successful interface, that we
> could copy.
Maybe good examples would be Flask-OAuth [1] and Flask-OpenId [2],
which use python-oauth2 [3] and python-openid [4]. gorakhargosh is
working on a new oauth lib [5] but it is still a work in progress.
> I plan on using ndb for the User model and also allow for multiple accounts.
> Here's a sample <
https://gist.github.com/1059647>.
Cool. I also made a ndb user model a while ago, and one thing I added
was multiple session support (login on multiple machines), which
tipfy.auth doesn't handle and was a feature request. Again, I have to
take a better look at it and publish this somewhere.
> I'll probably end up creating this as a separate module that can later be
> merged into webapp2_extends, I want to make sure that I'm implementing it in
> a manner that's consistant with your goals, so any direction that you can
> give is greatly appreciated.
That would be great. Keeping it separated until we solidify an API is
probably the best. I'll see what I have so far and let you know.
-- rodrigo
[1]
http://packages.python.org/Flask-OAuth/
[2]
http://packages.python.org/Flask-OpenID/
[3]
https://github.com/simplegeo/python-oauth2/
[4]
http://pypi.python.org/pypi/python-openid/
[5]
https://github.com/gorakhargosh/pyoauth/