By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,985 Members | 1,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,985 IT Pros & Developers. It's quick & easy.

Basic Auth for simple web server

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
Thanks

--
Marco Aloisio
Jun 7 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.