[Grok-dev] zope.pluggableauth is not working.

Shrek Zhou zgwmike at gmail.com
Sun Nov 7 00:50:45 EDT 2010


Hi, Souheil,
I already did that. and found a way to make it working.
Here are the steps.
With all the code I pasted in the previous message.
Add a grok view for IUnauthorized

from zope.security.interfaces import IUnauthorized
class Unauthorized(grok.View):
    grok.context(IUnauthorized)
    grok.name("index.html")
    grok.require("zope.Public")
    def render(self):
        principal=self.request.principal
        auth=getUtility(IAuthentication)
        auth.unauthorized(principal.id,self.request)
        if self.request.response.getStatus() not in (302,303):
            return "Not authorized!"

Then, If no application is added, the basic auth will work.
if an application added, it will use the local utility implementing
IAuthentication.


Regards,
Shrek

On Sat, Nov 6, 2010 at 11:17 PM, Souheil CHELFOUH <trollfot at gmail.com>wrote:

> Hello Shrek,
>
> You are not alone :)
> The authentication process can be a pain and the stack is hardly
> comprehensible.
> What I can do is :
>
> 1. Try the code you pasted on your previous messages
> 2. Debug
> 3. Send you a summary of what is needed to make it work.
>
> After this, I will spend time writting a tutorial to cover a bit more
> in-depth this issue
>
> - Souheil
>
> I will try to summariez
>
> 2010/11/6 Shrek Zhou <zgwmike at gmail.com>:
> >
> > Does zope.pluggableauth work for Grok 1.2 now?
> > if it does, how to configure?
> > --
> > View this message in context:
> http://old.nabble.com/zope.pluggableauth-is-not-working.-tp30147447p30147447.html
> > Sent from the Grok mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > Grok-dev mailing list
> > Grok-dev at zope.org
> > https://mail.zope.org/mailman/listinfo/grok-dev
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/grok-dev/attachments/20101107/67a9f074/attachment.html 


More information about the Grok-dev mailing list