[Zope] html form authentication

Iņigo Serna inigoserna@terra.es
31 Mar 2003 20:38:55 +0200


--=-X/z3OIyFTscFtZkydRq0
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

Thanks, CookieCrumbler is exactly what I need.
I also looked at exUserFolder, but it seemed a  bit complex for me, I'm
just a YAN (Yet Another Newbie ;-).

Thanks again,
I=F1igo

El dom, 30 de 03 de 2003 a las 22:49, Eron Lloyd escribi=F3:
> Perhaps it would be quite valuable to take CookieCrumbler or some equival=
ent =20
> and have it migrated into the official core (like the Core Session Manage=
r=20
> was)? It seems enough people are looking for this feature...
>=20
> Regards,
>=20
> Eron
>=20
> On Sunday 30 March 2003 12:24 pm, Jens Vagelpohl wrote:
> > use the CookieCrumber product (-> search zope.org) to do cookie-based
> > authentication. do not attempt to "hand-roll" authentication by calling
> > methods on the user folder. it will not work.
> >
> > jens
> >
> > On Sunday, Mar 30, 2003, at 10:58 US/Eastern, I=F1igo Serna wrote:
> > > Hello,
> > >
> > > I want to authenticate users from acl_users with my own HTML form and
> > > a python script.
> > > I can't use user._getPassword() because it's an internal method.
> > > and it seems user.authenticate function calls browser authentication
> > > again.
> > > How could I achieve this?
> > >
> > > This is the code I use:
> > >
> > > *************** ZPT "form" ***************
> > > ...
> > >         <form action=3D"login" method=3D"post">
> > >           <table class=3D"form">
> > >             <tbody>
> > >               <tr>
> > >                 <th class=3D"text">Name: </th>
> > >                 <td><input name=3D"user" size=3D"12" maxlength=3D"12"
> > > value=3D""></td>
> > >               </tr>
> > >               <tr>
> > >                 <th class=3D"text">Password: </th>
> > >                 <td><input name=3D"password" type=3D"password" size=
=3D"12"
> > > maxlength=3D"8" value=3D""></td>
> > >               </tr>
> > >               <tr><td>&nbsp;</td></tr>
> > >               <tr>
> > >                 <td align=3D"center">
> > >                   <input type=3D"reset" value=3D"Clean">
> > >                 </td>
> > >                 <td align=3D"center">
> > >                   <input type=3D"SUBMIT" value=3D"Submit">
> > >                 </td>
> > >               </tr>
> > >             </tbody>
> > >           </table>
> > >         </form>
> > > ...
> > > *********************************************
> > >
> > > *************** Script (Python) "login" ***************
> > > request =3D container.REQUEST
> > > RESPONSE =3D  request.RESPONSE
> > > user =3D container.acl_users.getUser(request.user)
> > > try:
> > >     if user.authenticate('the_password', request):
> > >         print 'OK'
> > >     else:
> > >         print 'FAILED'
> > > except AttributeError:
> > >     print 'User doesn\' exist'
> > > return printed
> > > *********************************************
> > >
> > > Thanks in advance,
> > > I=F1igo
> > > <signature.asc>
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://mail.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://mail.zope.org/mailman/listinfo/zope-announce
> >  http://mail.zope.org/mailman/listinfo/zope-dev )
> > ---
> > [This E-mail scanned for viruses by Declude Virus]
>=20
>=20
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -=20
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
--=20
I=F1igo Serna <inigoserna@terra.es>
Katxijasotzaileak

--=-X/z3OIyFTscFtZkydRq0
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA+iIs+fN63/+cBjZoRAi+yAJ49J4UsUQYNFqeCObIwgy1JN/Z5AwCfdPLd
dlfZD9NitEWRzrmg/sm271k=
=q8DG
-----END PGP SIGNATURE-----

--=-X/z3OIyFTscFtZkydRq0--