views:

5268

answers:

3

Does anyone know or know of somewhere I can learn how to create a custom authentication process using python and google app engine?

I don't want to use google accounts for authentication and want to be able to create my own users.

If not specifically for google app engine, any resource on how to implement authentication using python and django?

+9  A: 

Well django 1.0 was updated today on Google AppEngine. But you can make user authentication like anything else you just can't really use sessions because it is so massive.

There is a session utility in http://gaeutilities.appspot.com/

http://gaeutilities.appspot.com/session

http://code.google.com/p/gaeutilities/

Or,

You have to create your own user tables and hash or encrypt passwords, then probably create a token system that mimics session with just a token hash or uuid cookie (sessions are just cookies anyways).

I have implemented a few with just basic google.webapp request and response headers. I typically use uuids for primary keys as the user id, then encrypt the user password and have their email for resets.

If you want to authorize users for external access to data you could look at OAuth for application access.

If you just want to store data by an id and it is more consumer facing, maybe just use openid like stackoverflow and then attach profile data to that identifier like django profiles (http://code.google.com/p/openid-selector/).

django 1.0 just came out today on GAE but I think the same problems exist, no sessions, you have to really create your own that store session data.

Ryan Christensen
Wow, sounds difficult. I didn't know we could not use sessions. I guess I'm looking for some type of premade authentication functionality that I could just drop into my app.
metanaito
Yeh with that http://gaeutilities.appspot.com/session library all you would have to do is then handle the user registration to that. The cloud is pretty much without session and joins etc, anything that is stuck to one machine has to have new ways of doing things.
Ryan Christensen
I didn't think of that (about the sessions and cloud). Thank you for the links.
metanaito
I made my own session library using memcache and cookies. It's actually really simple to make authentication stuff, I built it completely from scratch.
Josh Patton
+5  A: 

The OpenID consumer (part of the excellent "app engine samples" open source project) currently works (despite the warnings in its README, which is old) and would let you use OpenID for your users' logins.

django's auth is also usable, via e.g. this project (at least the users part, not necessarily groups and permissions though they might get them working any time).

Alex Martelli
That is interesting, but we want to be able to create users ourselves and provide username/passwords to users. We won't be allowing outside registration.
metanaito
Why not? You can still do user registration with OpenID - just create the user and ask for registration information (but not username/password) when they first log in with a new openid.
Nick Johnson
We want to control the user access to the system, including the user id and password. That's why open id is not being used.
metanaito
+3  A: 

Have a look app-engine-patch for Django (your preferred framework I assume from your question). It offers authentication on gae.

Alternatively, take a look at web2py. It's a Python-based framework that works on GAE and Relational databases. It's built-in Auth object provides for users, groups and permissions.

It doesn't give unbridled access to BigTable though, instead offering a subset of relational functionality (BigTable doesn't support Joins for example and web2py doesn't [yet] support BigTable models).

Support for BigTable is being discussed by both Web2py and Django communities.

Carl