Mike Orr <[EMAIL PROTECTED]>:
>
[...]
> RewriteCond %{HTTP:Authorization}  ^(.*)
> RewriteRule ^/(.*) /usr/lib/cgi-bin/Zope.cgi/M/$1 \
> [e=HTTP_CGI_AUTHORIZATION:%1, t=application/x-httpd-cgi,l]
 
Thanks. I've found several versions of this on the web and I think I
understand the way it ought to function -- but I can't make it work.
Even if I supply a literal value for HTTP_CGI_AUTHORIZATION, I can't
find it with req.hasField afterwards...

I basically have code like this:

if not req.hasField('HTTP_CGI_AUTHORIZATION'):
    res.addHeader('WWW-Authenticate', 'Basic realm=Something')
    res.setStatus(401)
    self.write('Authorisation required')
    return
else:
    # Get HTTP_CGI_AUTHORIZATION and perform a login check etc.

However, it only seems to enter the first clause, repeatedly asking me
for a usernam/password. I would have thought that after having
provided that, the field HTTP_CGI_AUTHORIZATION should be set, thus
avoiding the authentication headers etc... Is there something wrong
with this code? (It would obviously seem so...)

And, BTW -- what form does the HTTP_CGI_AUTHORIZATION header have?
Username/password separated somehow?

--
Magnus Lie Hetland                                  The Anygui Project
http://hetland.org                                  http://anygui.org

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to