<br>Hi, Souheil,<div>I already did that. and found a way to make it working.</div><div>Here are the steps.</div><div>With all the code I pasted in the previous message.</div><div>Add a grok view for <font class="Apple-style-span" color="#333333">IUnauthorized</font></div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div><font class="Apple-style-span" color="#666666">from zope.security.interfaces import IUnauthorized</font></div><div><div><font class="Apple-style-span" color="#666666">class Unauthorized(grok.View):</font></div>
<div><font class="Apple-style-span" color="#666666"> grok.context(IUnauthorized)</font></div><div><font class="Apple-style-span" color="#666666"> <a href="http://grok.name">grok.name</a>("index.html")</font></div>
<div><font class="Apple-style-span" color="#666666"> grok.require("zope.Public")</font></div><div><font class="Apple-style-span" color="#666666"> def render(self):</font></div><div><font class="Apple-style-span" color="#666666"> principal=self.request.principal</font></div>
<div><font class="Apple-style-span" color="#666666"> auth=getUtility(IAuthentication)</font></div><div><font class="Apple-style-span" color="#666666"> auth.unauthorized(<a href="http://principal.id">principal.id</a>,self.request)</font></div>
<div><font class="Apple-style-span" color="#666666"> if self.request.response.getStatus() not in (302,303):</font></div><div><font class="Apple-style-span" color="#666666"> return "Not authorized!" </font></div>
<div><font class="Apple-style-span" color="#666666"><br></font></div><div>Then, If no application is added, the basic auth will work.</div><div>if an application added, it will use the local utility implementing IAuthentication.</div>
<div><br></div><div><br></div><div>Regards,</div><div>Shrek</div><div><br></div><div class="gmail_quote">On Sat, Nov 6, 2010 at 11:17 PM, Souheil CHELFOUH <span dir="ltr"><<a href="mailto:trollfot@gmail.com">trollfot@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello Shrek,<br>
<br>
You are not alone :)<br>
The authentication process can be a pain and the stack is hardly comprehensible.<br>
What I can do is :<br>
<br>
1. Try the code you pasted on your previous messages<br>
2. Debug<br>
3. Send you a summary of what is needed to make it work.<br>
<br>
After this, I will spend time writting a tutorial to cover a bit more<br>
in-depth this issue<br>
<br>
- Souheil<br>
<br>
I will try to summariez<br>
<br>
2010/11/6 Shrek Zhou <<a href="mailto:zgwmike@gmail.com">zgwmike@gmail.com</a>>:<br>
><br>
> Does zope.pluggableauth work for Grok 1.2 now?<br>
> if it does, how to configure?<br>
> --<br>
> View this message in context: <a href="http://old.nabble.com/zope.pluggableauth-is-not-working.-tp30147447p30147447.html" target="_blank">http://old.nabble.com/zope.pluggableauth-is-not-working.-tp30147447p30147447.html</a><br>
> Sent from the Grok mailing list archive at Nabble.com.<br>
><br>
> _______________________________________________<br>
> Grok-dev mailing list<br>
> <a href="mailto:Grok-dev@zope.org">Grok-dev@zope.org</a><br>
> <a href="https://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">https://mail.zope.org/mailman/listinfo/grok-dev</a><br>
><br>
</blockquote></div><br></div>