Authentication using a form instead of a popup
Hi all! I have an intranet which has a restricted access, so users have to authenticate before entering in it. But I don't want the authentication to be done by a popup window, so I've made two DTML methods. The first is the authentication form itself, which asks for name and password: <form name="userdata" action="check" method="get"> <p>User: <input type="text" name="username"></p> <p>Password: <input type="password" name="userpassword"></p> <input type="submit" value="Enter"> </form> The second is the DTML method that makes the checkings, and it is called check: <dtml-if "acl_users.authenticate(username,userpassword,REQUEST)"> <dtml-call "RESPONSE.redirect('intranet')"> <dtml-else> Error!! </dtml-if> The "acl_users.authenticate" part seems to work OK, as it returns an error if the user or password is wrong. And if they are OK, it tries to redirect to the intranet, that is to say, the restricted part. But the problem is that at this time it asks again for username and password, using a popup window. What I am doing wrong, or what am I missing? Any ideas? Thanks in advance, Igor Leturia
Igor Leturia wrote:
What I am doing wrong, or what am I missing? Any ideas? Thanks in advance,
Read the Zope Book about Roles and Permissions. Use Shane Hathaway's CookieCrumbler product to get cookie-based authentication... cheers, Chris
On Friday, May 23, 2003, at 05:09 US/Eastern, Igor Leturia wrote:
<dtml-if "acl_users.authenticate(username,userpassword,REQUEST)"> <dtml-call "RESPONSE.redirect('intranet')"> <dtml-else> Error!! </dtml-if>
The "acl_users.authenticate" part seems to work OK, as it returns an error if the user or password is wrong. And if they are OK, it tries to redirect to the intranet, that is to say, the restricted part. But the problem is that at this time it asks again for username and password, using a popup window.
What I am doing wrong, or what am I missing? Any ideas? Thanks in advance,
Igor Leturia
you cannot just call methods on the user folder "manually" and expect the user to get logged in magically by doing that. you should be using a user folder that handles cookies or use the CookieCrumbler product. jens
participants (3)
-
Chris Withers -
Igor Leturia -
Jens Vagelpohl