[opencms-dev] How to login user

Antonio Cordeddu antoniocordeddu at coranto.it
Tue Jul 23 20:40:41 CEST 2013


Hi Jakub,

I was struggling in the same problem.
You can use the method  switchUser(CmsObject cms, HttpServletRequest 
req, CmsUser user) on CmsSessionManager (but the user must be a 
Workplace user).

Otherwise you can set userid and password in a session variable, get the 
values from the session and then use the loginUser method.
I hope this is useful for you.
Kind regards

Antonio Cordeddu



On 21/07/2013 9.47, Jakub Jec(mínek wrote:
> Hi,
> I'm trying to develope a "remember me" functionality to OpenCms based 
> on cookies and the best practices described here 
> http://jaspan.com/improved_persistent_login_cookie_best_practice.
> Only problem that I have is that I don't know how to login user 
> programatically after it was verified that his cookie is valid. I know 
> that there is method
> loginUser(java.lang.String username, java.lang.String password) on 
> CmsObject. But this requires knowledge of user's password and I don't 
> want to store user's password in the cookie for security reasons, not 
> even if it was hashed. Is there any other way how to login user 
> programatically? Or has anybody tried to create this functionality in 
> the OpenCms?
>
> Thanks.
>
> Jakub Jec(mínek
> ------------------------------------------------
> NELASOFT Technologies, s.r.o.
> Mob: +420 604 575 772
> E-mail: jakub.jecminek at nelasoft.cz <mailto:jakub.jecminek at nelasoft.cz>
> Web: www.nelasoft.cz <http://www.nelasoft.cz/>
>
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
>

  

_______________________________________
Coranto informatica di Antonio Cordeddu
Via Torricelli, 9 09047 Selargius (CA)
antoniocordeddu at coranto.it
Skype: antonio.cordeddu
http://www.coranto.it
___________________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20130723/8627536c/attachment.htm>


More information about the opencms-dev mailing list