views:

389

answers:

3

I would like to test appengine. At this moment it is not clear to me if there are libraries that support custom authentication. I want the user to be able to create an account on the site without having to have a google (or any other) account.

Does that kind of libraries exists or do you have to write it from scratch? Can anyone provide me with some step by step example? (if such library exists of course..)

(I would like to use Java if possible)

Thanks!

A: 

Don't you want to consider Google Friend Connect authentication? It includes not only Google accounts, but also Yahoo, Open ID and some others and pretty easy to setup.

Dmitry
A: 

Did you find asolution for this? I have looked high and low for some help on adding some custom user middlewear. Let me know what you did.

spidee
+1  A: 

I'm not aware about any libraries designed specifically for supporting custom login. However, what you need for is ability to store session-specific data and this is doable via Session library from gaeutilities that implements sessions based on cookies and datastore.

Link: http://gaeutilities.appspot.com/session

Example:

from appengine_utlities import sessions

def authenticate(login, password):
    user = User.all().filter('login', login).filter('password', password).get()
    if not user: return False

    s = sessions.Session()
    s["user"] = user
    return True

def is_authenticated():
    s = sessions.Session()
    return s.has_key("user")

def get_user():
    s = sessions.Session()
    return s["user"] if s.has_key("user") else None
Xion