[Twisted-Python] cred question

Michele Petrazzo michele.petrazzo at unipex.it
Thu Nov 23 13:38:18 EST 2006

I'm trying to use the various checkers.* that implement the
ICredentialsChecker, for authenticate a spread.pb client, but I have a
lot of problem with all the checkers except the
InMemoryUsernamePasswordDatabaseDontUse (and FilePasswordDB without hash
function) that work.
The output message are:
"""Failure: twisted.cred.error.UnhandledCredentials: No checker for
twisted.spread.pb.IUsernameMD5Password, twisted.spread.interfaces.IJellyable

My server code:
class MyRealm:
     __implements__ = portal.IRealm
     def requestAvatar(self, avatarId, mind, *interfaces):
         if pb.IPerspective not in interfaces:
             raise NotImplementedError
         return pb.IPerspective, MyPerspective(avatarId), lambda:None

class MyPerspective(pb.Avatar):
     def __init__(self, name):
         self.name = name
         print "\n\nServer: New connection: %s"%name

p = portal.Portal(MyRealm())
c = checkers.InMemoryUsernamePasswordDatabaseDontUse(user2="pass2")
#or c = checkers.FilePasswordDB("passwd") that work
#or c = checkers.FilePasswordDB("passwd", hash=hash_funct) that don't
#or c = checkers.AllowAnonymousAccess()

reactor.listenTCP(8800, pb.PBServerFactory(p))


How can I use the various FilePasswordDB with the hash or the others?


More information about the Twisted-Python mailing list