Hi,  I'm diving into creating my own repoze plugins, but am getting
lost.  I've got a face-less web-services-only server going... and it
just doesn't make any sense to redirect to a login page... because
nobody is looking at any pages.      I'm looking at the plugin sources
for a half a dozen plugins, and trying to grok how to do my own...  I
see in the IAuthenticator interfaces source... I can set my metadata
and authenticate all at once easily.

So I think I've done the 'heart' of what I want to do.  But I want to
retain the turbogears-standard authorization with groups and roles,
and predicates.   What is the best resource I can follow to integrate
my Authenticator to replace the easy-forms part of the standard auth,
but keep the rest?

Thanks!


class IDateShaAuthenticator(IPlugin):
   def authenticate(self, environment, identity):

      if not 'user_email' in identity:
         return None
      if not 'auth_hash' in identity:
         return None
      user_email = identity['user_email']
      cred_hash = identity['auth_hash']
      user = model.User.by_email_address(user_email)

      userid = None
      if user.matchesHash(cred_hash):
         identity['repoze.who.userid'] = cred_id
         identity['user'] = user
         userid = user.id
      #
      return userid
   #
#

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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?hl=en.

Reply via email to