[Zope] a login link

Dieter Maurer dieter@handshake.de
Fri, 14 Mar 2003 23:14:28 +0100

Bryan C. Andregg wrote at 2003-3-14 08:58 -0500:
 > I'd like to provide a link, whereby clicking it would generate a login prompt
 > and then return to the calling page.
 > I thought I'd just create a script, viewable by only the people in the role
 > that I want to login.
 > I did this, and tried just to use,
 > context.REQUEST.RESPONSE.redirect(context.REQUEST['HTTP_REFERER'])
 > This doesn't work. Or I should say, it half works. If the login is successful,
 > the page is returned but the user object hasn't been updated (has_roles()
 > doesn't work) and subsiquent clicks of the link don't prompt for
 > authentication.

A typical HTTP authentication behaviour:

  Login information is automatically send to the subhierarchy
  rooted in the parent of the object that did require
  the authentication.

The HTTP 1.1 specification tells you more (if it is not enough).