Re: shiro UsernamePasswordToken RememberMe problems
I believe that remember me works only in production mode by default. On Feb 25, 2014, at 2:44 AM, Lidija Dolinar wrote: Hi, I tried Remember Me functionality here: http://tynamo-federatedaccounts.tynamo.org/ (live demo webapp) but the user isn't remembered. When I check the Remember Me checkbox and login, the cookie rememberMe is created. After I close the browser and reopen it again I'm not logged in. Am I missing something here? I'm struggling with the creation of the rememberMe cookie. This is my Login.java: public Object onActionFromJsecLoginForm() { Subject currentUser = securityService.getSubject(); if (currentUser == null) { throw new IllegalStateException(Subject can`t be null); } UsernamePasswordToken token = new UsernamePasswordToken(jsecLogin, jsecPassword); token.setRememberMe(true); try { currentUser.login(token); } ... } This is taken from shiro documentation ( https://shiro.apache.org/authentication.html): //Example using most common scenario of username/password pair:UsernamePasswordToken token = new UsernamePasswordToken(username, password); //Remember Me built-in:token.setRememberMe(true); However, the cookie rememberMe isn't created :-/. What am I missing? Regards, Lidija - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: shiro UsernamePasswordToken RememberMe problems
On Mon, Feb 24, 2014 at 11:44 PM, Lidija Dolinar lidija@gmail.comwrote: I tried Remember Me functionality here: http://tynamo-federatedaccounts.tynamo.org/ (live demo webapp) but the user isn't remembered. When I check the Remember Me checkbox and login, the cookie rememberMe is created. After I close the browser and reopen it again I'm not logged in. Am I missing something here? Shiro makes a strong separation between remembered and authenticated use cases. It depends on your security settings whether you want to allow remembered only users. The built-in Shiro rememberMe cookie is in not secure. I've written about the topic several times. RollingTokenRealm (at the end of http://tynamo.org/tynamo-federatedaccounts+guide) was born out of the need to support a (more) secure rememberMe use case. (And to Lenny, no, productionMode does not effect this functionality in any way). I'm struggling with the creation of the rememberMe cookie. This is my Login.java: public Object onActionFromJsecLoginForm() { Subject currentUser = securityService.getSubject(); if (currentUser == null) { throw new IllegalStateException(Subject can`t be null); } UsernamePasswordToken token = new UsernamePasswordToken(jsecLogin, jsecPassword); token.setRememberMe(true); try { currentUser.login(token); } ... } However, the cookie rememberMe isn't created :-/. What am I missing? Are you sure the cookie isn't created or it just doesn't work the way you expected? I.e. user is not logged in. Kalle
Re: How to pass a javascript function in tapestry mixin
Sorry Thaigo, but I am not sure what you had in mind. If you think about That's something to avoid as much as possible. Well first I am not sure why is this the case. If tapestry supports passing configurations in this way then it should support passing functions when those configurations are expecting them. However I would be open to avoid doing this but I dont see a way to do it, other then overwriting javascript files and putting my code directly there. I was able to identify the scenario that leads to this problem. The ajaxUpload component needs to be surrounded by the zone, if that is not the case then a function can be passed without any issues. Sadly in my code the zone is necessary. I will try to reach to the tapestry5-jquery developer to see if he thinks this is a bug and can it be fixed. Thanks for the help and please if you have any idea how to avoid passing the function (that doesn't involve overwriting existing files) I will be happy to try it out. Cheers On Tue, Feb 25, 2014 at 3:10 AM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Mon, 24 Feb 2014 19:53:59 -0300, Boris Horvat horvat.z.bo...@gmail.com wrote: Anyone has any idea about this? :) I already gave you my suggestion. -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Sincerely *Boris Horvat*
Reading messages for a different Locale than default locale
Hi I am a beginner with tapestry and have a question about messages. Is it possible to read messages from a different locate other than the default locale that is set in tapestry web application. I need this because in the web application I am working on, no matter what the locale is, some messages in some contexts always need english values. Thankyou