[Grok-dev] Session based auth in Grok 1.1rc1

Jeffrey D Peterson bgpete at gmail.com
Tue Apr 6 15:54:40 EDT 2010


So I should still be using zope.app.authentication? Did you mean
zope.authentication? 

Because I am not using it at all, my imports have gone from:

from zope.authentication.interfaces import IPasswordManager
from zope.authentication.authentication import PluggableAuthentication
from zope.app.authentication.session import SessionCredentialsPlugin
from zope.app.security.interfaces import (IAuthentication,
                                          IUnauthenticatedPrincipal,
                                          ILogout)
from zope.app.authentication.interfaces import ICredentialsPlugin
from zope.app.authentication.interfaces import IAuthenticatorPlugin
from zope.app.authentication.interfaces import IPrincipalInfo


to:

from zope.password.interfaces import IPasswordManager
from zope.pluggableauth import PluggableAuthentication
from zope.pluggableauth.plugins.session import SessionCredentialsPlugin
from zope.authentication.interfaces import (IAuthentication,
                                            IUnauthenticatedPrincipal,
                                            ILogout)
from zope.pluggableauth.interfaces import (ICredentialsPlugin,
                                           IAuthenticatorPlugin,
                                           IPrincipalInfo,
                                           IFoundPrincipalFactory)

from zope.pluggableauth.factories import PrincipalInfo

Is this not correct?

Thanks,

Jeff.

> -----Original Message-----
> From: Souheil CHELFOUH [mailto:trollfot at gmail.com]
> Sent: Tuesday, April 06, 2010 2:30 PM
> To: Jeffrey D Peterson
> Cc: grok-dev at zope.org
> Subject: Re: [Grok-dev] Session based auth in Grok 1.1rc1
> 
> zope authentication has been split in two :
> zope.pluggable auth and zope.app.authentication.
> Make sure you include both zcml in your application. It should work as
> it used to.
> 
> 2010/4/6 Jeffrey D Peterson <bgpete at gmail.com>:
> > All,
> >
> >
> >
> > I have been trying to replicate a working pattern for authentication
> in Grok
> > 1.1 and I have hit a wall.
> >
> >
> >
> > Everything seems to work as expected but for two things:
> >
> >
> >
> > 1)      I can’t seem to get the app to redirect to the login page,
> (which I
> > can type myself to)
> >
> > 2)      Once I type myself to the login page and enter credentials,
> it flows
> > through fine, redirects to the index page and drops this exception:
> >
> >
> >
> > 2010-04-06 14:01:51,729 ERROR [SiteError]
> > http://portal-dev.craryindustries.com/@@index
> >
> > Traceback (most recent call last):
> >
> >   File
> > "/home/zope/.buildout/eggs/zope.publisher-3.12.0-
> py2.5.egg/zope/publisher/publish.py",
> > line 131, in publish
> >
> >     obj = request.traverse(obj)
> >
> >   File
> > "/home/zope/.buildout/eggs/zope.publisher-3.12.0-
> py2.5.egg/zope/publisher/browser.py",
> > line 556, in traverse
> >
> >     ob, add_steps = publication.getDefaultTraversal(self, ob)
> >
> >   File
> > "/home/zope/.buildout/eggs/grok-1.1rc1-
> py2.5.egg/grok/publication.py", line
> > 103, in getDefaultTraversal
> >
> >     request, ob)
> >
> >   File
> > "/home/zope/.buildout/eggs/zope.app.publication-3.10.2-
> py2.5.egg/zope/app/publication/browser.py",
> > line 36, in getDefaultTraversal
> >
> >     return ob.browserDefault(request)
> >
> >   File
> > "/home/zope/.buildout/eggs/zope.securitypolicy-3.6.1-
> py2.5.egg/zope/securitypolicy/zopepolicy.py",
> > line 277, in checkPermission
> >
> >     object, principal.id, self._groupsFor(principal), permission,
> >
> >   File
> > "/home/zope/.buildout/eggs/zope.securitypolicy-3.6.1-
> py2.5.egg/zope/securitypolicy/zopepolicy.py",
> > line 314, in _groupsFor
> >
> >     groups = self._findGroupsFor(principal, getPrincipal, [])
> >
> >   File
> > "/home/zope/.buildout/eggs/zope.securitypolicy-3.6.1-
> py2.5.egg/zope/securitypolicy/zopepolicy.py",
> > line 295, in _findGroupsFor
> >
> >     group = getPrincipal(group_id)
> >
> >   File
> > "/home/zope/.buildout/eggs/zope.pluggableauth-1.0.1-
> py2.5.egg/zope/pluggableauth/authentication.py",
> > line 89, in getPrincipal
> >
> >     principal = interfaces.IFoundPrincipalFactory(info)(self)
> >
> > TypeError: ('Could not adapt',
> > PrincipalInfo('83864CA7855EE435E040007F01002753'), <InterfaceClass
> > zope.pluggableauth.interfaces.IFoundPrincipalFactory>)
> >
> >
> >
> > The Authenticator Plugin is supposed to return an implementation of
> > IPrincipalInfo which
> PrincipalInfo('83864CA7855EE435E040007F01002753') is
> > and I am not sure why it’s having this issue.
> >
> >
> >
> > Any insight would be appreciated. BTW
this worked with Grok 1.0 and
> all the
> > zope.app dependencies.
> >
> >
> >
> > TIA,
> >
> >
> >
> > Jeff Peterson
> >
> > Webmaster
> >
> > Crary Industries, Inc.
> >
> >
> >
> >
> >
> > _______________________________________________
> > Grok-dev mailing list
> > Grok-dev at zope.org
> > https://mail.zope.org/mailman/listinfo/grok-dev
> >
> >



More information about the Grok-dev mailing list