Re: Web authentication
From: John J. Lee (jjl_at_pobox.com)
Date: 12/05/03
- Next message: John J. Lee: "Re: stddev bug in util.py"
- Previous message: Chris Liechti: "Re: py2exe: problem including libxml2"
- In reply to: Paul Rubin: "Re: Web authentication"
- Next in thread: Paul Rubin: "Re: Web authentication"
- Reply: Paul Rubin: "Re: Web authentication"
- Reply: Alan Kennedy: "Re: Web authentication"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 04 Dec 2003 23:45:23 +0000
Paul Rubin <http://phr.cx@NOSPAM.invalid> writes:
> "luigipaioro" <luigipaioro@libero.it> writes:
> > Does anybody know how can I acces to my site with authentication?
> >
> > I think that urllib2 can help me but I don't undestand how!!!
>
> It's documented in the manual. Try something like (untested):
>
> import urllib
>
> class Open_with_auth(urllib.FancyURLopener):
> def prompt_user_passwd(self, host, realm):
> return ('username', 'userpassword') # the uid and passwd you want to use
>
> urllib._urlopener = Open_with_auth()
Doesn't/shouldn't http://user:passwd@example.com/blah.html work?
I don't know where that syntax is specified (if anywhere) -- do you
know, Paul? It seems at a glance that urllib understands that syntax
for ordinary Basic Auth., where urlib2 only knows it as a syntax for
proxy Basic Auth., but I may be wrong there...
John
- Next message: John J. Lee: "Re: stddev bug in util.py"
- Previous message: Chris Liechti: "Re: py2exe: problem including libxml2"
- In reply to: Paul Rubin: "Re: Web authentication"
- Next in thread: Paul Rubin: "Re: Web authentication"
- Reply: Paul Rubin: "Re: Web authentication"
- Reply: Alan Kennedy: "Re: Web authentication"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]