[Zope3-Users] Pluggable authentication, a newbie's question
Alexei Ustyuzhaninov
alust at 208.195-224-87.telenet.ru
Sun Jan 28 11:44:22 EST 2007
Hello,
I try to create a plugin, which could authenticate users against an
external database. Here is the code:
from zope.component import provideUtility
from zope.app.authentication import PluggableAuthentication
from zope.app.authentication.interfaces import\
ICredentialsPlugin, IAuthenticatorPlugin
from zope.app.authentication.session import SessionCredentialsPlugin
from zope.app.security.interfaces import IAuthentication
from mypackage.Authentication import MyAuthenticatorPlugin
provideUtility(SessionCredentialsPlugin(), ICredentialsPlugin,\
'My Credentials Plugin')
provideUtility(MyAuthenticatorPlugin(), IAuthenticatorPlugin,
'My Authenticator Plugin')
pau=PluggableAuthentication('my_')
pau.credentialsPlugins=('Cascade Credentials Plugin', )
pau.authenticatorPlugins=('Cascade Authenticator Plugin', )
provideUtility(pau, IAuthentication, 'My Pluggable-Authentication Utility'
This code is contained in the file mypackage/__init__.py, mypackage in
turn is loaded via ZCML. Both plugins and PAU are registered
successfully and I can access them with queryUtility. But the
authentication is carried through the standard mechanism and
MyAuthenticatorPlugin isn't even called.
Could any good soul help me with this case?
--
Thanks,
Alexei
More information about the Zope3-users
mailing list