Ian Bicking wrote:
> Okay, now I really want to get HTTP authentication working.  Here's
> where I am:
> 
> The Zope mod_rewrite style kind of works, but I can't get it to actually
> set an environmental variable -- either for mod_webkit or WebKit.cgi. 
> You can put the authentication header in the URL as a get variable,
> though (of course, this is a big ol' security hole -- but at least it
> shows it kind of works).  So this is one problem.
> 
> With HTTPAdapter.py, of course there is no problem -- it passes
> everything on.  However, either way I don't really know what to do with
> the value once I get it.  If I try to login as test:test in the realm
> "Password Required", a header like this is sent:
> 
> Authorization: Basic dGVzdDp0ZXN0
> 
> That's the only extra header.  It's not plaintext, that's for sure. 
> (Same in Mozilla and NS 4)

import base64
user_passwd= "%s:%s" % (username,passwd)
auth=string.strip(base64.encodestring(user_passwd))

Decode with:

 >>> import base64
 >>> dir(base64)
['MAXBINSIZE', 'MAXLINESIZE', '__all__', '__builtins__', '__doc__', 
'__file__',
'__name__', 'binascii', 'decode', 'decodestring', 'encode', 
'encodestring', 'test', 'test1']
 >>> base64.decodestring('dGVzdDp0ZXN0')
'test:test'


There's an ACL script I also just came across
that might be of interest:
http://synergy.as.cmu.edu/~geek/transferables/html_acl.html


-- 
Bill Eldridge
Radio Free Asia
[EMAIL PROTECTED]



_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to