[opencms-dev] How to login user
Christian Steinert
christian at christian-steinert.de
Sun Jul 21 12:44:44 CEST 2013
Dear Jakub
I know no possibility to log in somebody programatically without knowing their password. There are only a few exceptions where this is possible (export user, guest user) but I don't think that the API can do this for normal workplace users. You may have to hunt through the source code of CmsObject.loginUser(...) to see if there is any way around this limitation but I could well imagine that it is not possible to do password-less login with a reasonable amount of work. Maybe I am wrong though - I never had a need to dig into the source code for this.
The passwords are hashed before they are stored in the opencms database. This is a good thing but it will prevent your application from knowing these passwords. So if anything you have to hunt for a way to get the user logged in without password.
Good luck!
Christian
> 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
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20130721/2a9c076a/attachment.htm>
More information about the opencms-dev
mailing list