[Twisted-Python] Twisted-Web: Authenticating a usersite-wide ??

Hi, I got a problem using a custom-made web-application built upon Twisted. My problem is that when I ask a user for authentication, the cookie or whatever it is, is not available in the request-object for other sites than the one who asked for authentication. I want the user to login on one page, which sets the correct info so I can use request.getUser() and request.getPassword() later on all other pages to validate access to the requested resources. In my RootResource I return something like this if I want the user authenticated: request.setHeader('WWW-authenticate', 'Basic realm="%s"' % ("/")) errpage = error.ErrorPage(http.UNAUTHORIZED, "Unauthorized", "401 Authentication required") return errpage.render(request) Is Basic realm = "/" correct if I want this authentication to be valid site-wide? What else can I use? What other approach can I use? Happy for any hints or clues. Thanks in advance, Thomas

Ok, then this might sound stupid, but if I got my server running on an ADSL-line using a dynamic DNS-service, should I then use the dynamic DNS-name or ... ??? What if this was to run on a LAN? What then? Apologize if this is off-topic and lame. Thomas ----- Original Message ----- From: "Jp Calderone" <exarkun@intarweb.us> To: <twisted-python@twistedmatrix.com> Sent: Sunday, January 04, 2004 12:16 AM Subject: Re: [Twisted-Python] Twisted-Web: Authenticating a usersite-wide ??

Thomas Weholt wrote:
Yes.
What if this was to run on a LAN? What then?
Use the name by which the server is known on the LAN, whether that's by means of an /etc/hosts (or windows/hosts, or whatever) mapping file, or by using SMB name lookup, or whatever. For example, our intranet server is called just "intranet", though that happens to translate to 192.168.0.42 most of the time... -Peter

Ok, then this might sound stupid, but if I got my server running on an ADSL-line using a dynamic DNS-service, should I then use the dynamic DNS-name or ... ??? What if this was to run on a LAN? What then? Apologize if this is off-topic and lame. Thomas ----- Original Message ----- From: "Jp Calderone" <exarkun@intarweb.us> To: <twisted-python@twistedmatrix.com> Sent: Sunday, January 04, 2004 12:16 AM Subject: Re: [Twisted-Python] Twisted-Web: Authenticating a usersite-wide ??

Thomas Weholt wrote:
Yes.
What if this was to run on a LAN? What then?
Use the name by which the server is known on the LAN, whether that's by means of an /etc/hosts (or windows/hosts, or whatever) mapping file, or by using SMB name lookup, or whatever. For example, our intranet server is called just "intranet", though that happens to translate to 192.168.0.42 most of the time... -Peter
participants (3)
-
Jp Calderone
-
Peter Hansen
-
Thomas Weholt