[Grok-dev] security ComponentLookupError: todo.auth.PrincipalInfo object

Christian Klinger cklinger at novareto.de
Fri Jul 23 05:46:53 EDT 2010


Hello Paul,

can you try to add this line in your configure.zcml

<include package="zope.app.authentication" />

And try it again.

Hope this helps...

Christian

> Hello grokkers,
>
> I use the chapter 7 on the security of the "grok 1.0” great book from
> "De la Guardia".
>
> where there is an auth.py module beginning by the following import lines.
>
> import grok
>
> from zope.app.authentication.session import SessionCredentialsPlugin
>
> from zope.app.authentication.interfaces import ICredentialsPlugin
>
> from zope.app.authentication.interfaces import IAuthenticatorPlugin
>
> from zope.app.authentication.interfaces import IPrincipalInfo
>
> from zope.app.authentication.interfaces import IPasswordManager
>
> from zope.app.security.interfaces import IAuthentication,
> IUnauthenticatedPrincipal, ILogout
>
> from zope.securitypolicy.interfaces import IPrincipalPermissionManager
>
> from zope.securitypolicy.interfaces import IPrincipalRoleManager
>
> from zope.app.authentication.principalfolder import InternalPrincipal
>
> from zope import component
>
> from zope.interface import Interface
>
> from zope import schema
>
> As admin I create one project, which can be accessed by
>
> http://xxx.xxx.xxx.xxx:xxxx/todo/0
>
> As admin I create a user ("user1").
>
> Then from one other browser I address the project with the address.
>
> http://xxx.xxx.xxx.xxx:xxxx/todo/0
>
> As expected the login page is displayed.
>
> I enter the user "user1" with the password.
>
> After the click on the button, the following lines are displayed.
>
> URL: http://xxx.xxx.xxx.xxx:xxxx/todo/%40%40login
>
> File
> '/root/.buildout/eggs/Paste-1.7.2-py2.5.egg/paste/evalexception/middleware.py',
> line 306 in respond
>
> app_iter = self.application(environ, detect_start_response)
>
> File
> '/root/.buildout/eggs/zope.app.wsgi-3.6.1-py2.5.egg/zope/app/wsgi/__init__.py',
> line 59 in __call__
>
> request = publish(request, handle_errors=handle_errors)
>
> File
> '/root/.buildout/eggs/zope.publisher-3.12.3-py2.5.egg/zope/publisher/publish.py',
> line 131 in publish
>
> obj = request.traverse(obj)
>
> File
> '/root/.buildout/eggs/zope.publisher-3.12.3-py2.5.egg/zope/publisher/browser.py',
> line 542 in traverse
>
> ob = super(BrowserRequest, self).traverse(obj)
>
> File
> '/root/.buildout/eggs/zope.publisher-3.12.3-py2.5.egg/zope/publisher/http.py',
> line 459 in traverse
>
> ob = super(HTTPRequest, self).traverse(obj)
>
> File
> '/root/.buildout/eggs/zope.publisher-3.12.3-py2.5.egg/zope/publisher/base.py',
> line 251 in traverse
>
> publication.callTraversalHooks(self, obj)
>
> File
> '/root/.buildout/eggs/zope.app.publication-3.10.2-py2.5.egg/zope/app/publication/zopepublication.py',
> line 135 in callTraversalHooks
>
> self._maybePlacefullyAuthenticate(request, ob)
>
> File
> '/root/.buildout/eggs/zope.app.publication-3.10.2-py2.5.egg/zope/app/publication/zopepublication.py',
> line 122 in _maybePlacefullyAuthenticate
>
> principal = auth.authenticate(request)
>
> File
> '/root/.buildout/eggs/zope.pluggableauth-1.0.1-py2.5.egg/zope/pluggableauth/authentication.py',
> line 71 in authenticate
>
> interfaces.IAuthenticatedPrincipalFactory)(self)
>
> File
> '/root/.buildout/eggs/zope.component-3.9.1-py2.5.egg/zope/component/_api.py',
> line 111 in getMultiAdapter
>
> raise ComponentLookupError(objects, interface, name)
>
> ComponentLookupError: ((<todo.auth.PrincipalInfo object at 0x414e110>,
>
> <zope.publisher.browser.BrowserRequest instance
> URL=http://xxx.xxx.xxx.xxx:xxxx/todo>), <InterfaceClass
> zope.pluggableauth.interfaces.IAuthenticatedPrincipalFactory>, u'')
>
> Did I miss something or the code should be updated for the version 1.1
> of grok?
>
> Thanks in advance for your help.
>
> Paul Divine
>
>
>
> _______________________________________________
> 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