I've moved on to taking care of authentication with CAS. I probably
will have to write my own provider, but CAS authentication can really
just be done with CherryPy controllers... there's no need to check
passwords against a database or anything. It's all just headers and
redirects.

Here's my login controller in Root:

@expose()
def login(self, ticket=None, *args, **kw):
    destination = request.base + request.path
    if ticket:
        user_name = cas.login(destination, ticket)
        if user_name:
            user = User.getOrCreate(user_name)
            identity.set_current_identity(user)
            identity.anonymous = False
            print "Current identity:", identity.current
        raise redirect('/')
    else:
        raise redirect(cas.loginURL(destination))

The CAS stuff works. User.getOrCreate returns my custom User SQLObject
class with my user_name and everything.  But when I redirect to '/' and
have the template print out identity.current.anonymous, it's still
True. Am I using this incorrectly?

The identity.current debug line prints an IdentityWrapper object.
Before I do further inspection, is there something I'm getting
fundamentally wrong with setting the current identity (like not having
a custom Provider class)?

Thanks,

--
Brian Beck
Adventurer of the First Order


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk
-~----------~----~----~----~------~----~------~--~---

Reply via email to