[Zope3-Users] How do I automatically login a user

Nando Quintana fquintana at codesyntax.com
Thu Apr 3 06:15:45 EDT 2008


Hi Kevin,

> During my registration process I want to automatically login the user (in
> Zope3).

After registration, I do the login in the same BrowserPage:

from zope.app.security.interfaces import IAuthentication
from zope.app import zapi

#[...]
# Registration staff
#[...]

# get the principal obj
pau =  zapi.getUtility(IAuthentication)
principal = pau['principals'][login]
principal.id = login
# set it to the request
self.request.setPrincipal(principal)

Bye,
Nando.

-- 
http://www.nandoquintana.com/contact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
	digitalmente
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20080403/9e0798d2/attachment.bin


More information about the Zope3-users mailing list