471,342 Members | 1,878 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,342 software developers and data experts.

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 2818
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 rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.