468,287 Members | 1,959 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,287 developers. It's quick & easy.

Basic Auth for simple web server

Hi, I'm a Python newbie;
I have to write a simple webserver, and I need to
implement a basic authentication as specified in the RFC2617.
I wonder if there is a Python library for doing that.

Thanks!

--
Marco Aloisio
Jun 5 '07 #1
3 2695
On Jun 5, 4:28 pm, Marco Aloisio <m...@valis-e.comwrote:
Hi, I'm a Python newbie;
I have to write a simple webserver, and I need to
implement a basic authentication as specified in the RFC2617.
I wonder if there is a Python library for doing that.

Thanks!

--
Marco Aloisio

Have a look at paste (http://pythonpaste.org/).

For instance, to enable authentication for user foo, you can do the
following

from paste.auth.basic import AuthBasicHandler

def only_for_foo(env, user, passwd):
return user == 'foo' and passwd = 'bar'

auth_app = AuthBasicHandler(
myapp, 'app realm', only_for_foo)

(where myapp is your WSGI application, of course).
Michele Simionato

Jun 5 '07 #2
Marco Aloisio <ma***@valis-e.comwrites:
Hi, I'm a Python newbie;
I have to write a simple webserver, and I need to
implement a basic authentication as specified in the RFC2617.
I wonder if there is a Python library for doing that.
twisted.web2 is one.
John
Jun 6 '07 #3
Thanks

--
Marco Aloisio
Jun 7 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Dan Stromberg | last post: by
7 posts views Thread by Michael Foord | last post: by
7 posts views Thread by Dave | last post: by
4 posts views Thread by Barry | last post: by
3 posts views Thread by Old Man | last post: by
reply views Thread by NPC403 | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.