Jon Clements wrote:
On 11 Nov, 07:02, Ken Seehart <k...@seehart.com> wrote:
  
I'm having some difficulty implementing a client that needs to maintain
an authenticated https: session.

I'd like to avoid the approach of receiving a 401 and resubmit with
authentication, for two reasons:

1. I control the server, and it was easy for me to make a url that
receives a POST with username, password and authenticates the session.  
The server keeps a session correctly when I test with a browser.  This
part works fine.

2. I don't want to send every request twice.  Seehttp://bugs.python.org/issue7159 There's no reason why I should have to
do this since I have the ability to keep the server simple.

What I would really like to do is send one request with the username and
password to establish the session, and then make multiple authenticated
requests where the session information remembers the authentication.

Is there a way to make this happen in python 2.5.2?

Keep in mind that this only needs to work with a particular server which
I control.  It does not need to function as a general purpose browser.  
The server is powered by Django.

- Ken
    

How about http://docs.djangoproject.com/en/dev/topics/auth/ and using
a urllib2 opener with cookie support ala some examples on
http://personalpages.tds.net/~kent37/kk/00010.html ?

hth,
Jon.
  
Thanks Jon, for the examples at Kent's Korner (good stuff for me to know in any case).  Actually, I ended up just simplifying everything by just sending username and password proactively on every request as POST arguments which are processed directly by the handler, and not using any session data after all.

- Ken

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to