Hello All,
I have created a very simple identity provider that is derived from
SqlObjectIdentityProvider.
Like the LDAP example, all I want is to check the password against an
external database.
I have been unable to figure out how to actually go about using the new
module. Do
change the provider in app.cfg? Does it have to reside in the tg
install tree? I just don't
see how to connect TG and my identity provider...
Any guidance is appreciated.
I have appended the module here.
Nicky
---
from turbogears.identity.soprovider import *
import turbogears
class SoJiraIdentityProvider(SqlObjectIdentityProvider):
"""
IdentityProvider that uses Jira for authentication.
"""
def __init__(self):
super(SoJiraIdentityProvider, self).__init__()
get = turbogears.config.get
self.host = get("identity.sojiraprovider.host", "jira-dev")
self.port = get("identity.sojiraprovider.port", 8080)
self.autocreate = get("identity.sojiraprovider.autocreate",
False)
log.info("JIRA host :: %s" % self.host)
log.info("JIRA port :: %d" % self.port)
log.info("autocreate :: %s" % self.autocreate)
def validate_password(self, user, user_name, password):
try:
import xmlrpclib
url = 'http://' + self.host + ':' + self.port +
'/rpc/xmlrpc'
s = xmlrpclib.ServerProxy(url)
s.jira1.login(user_name, password)
except xmlrpclib.Fault. e :
return False
else :
return True
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---