RE: Login Screenlet IOS password Expired

Juan Jose Olmos, modified 6 Years ago. New Member Posts: 2 Join Date: 4/18/18 Recent Posts

Hi:

I'm trying to catch the exception that tell me when the password have expired, so, when I tried from the web login liferay, on the console I can see: 

com.liferay.portal.kernel.exception.PasswordExpiredException but on the screenlet I always get the same exception: "Access denied to com.liferay.portal.kernel.service.UserService#getUserById", how can achive this?, to catch the PasswordExpiredException on the screenlet with the listener onLoginFailure

 

I'll appreciate your help smiley

thumbnail
Javier Gamarra, modified 6 Years ago. Expert Posts: 348 Join Date: 2/12/15 Recent Posts

Right now the screenlet or the remote services don't authenticate like the web (because all services require authentication and there isn't a remote service to authenticate) so it's not executing the checkPasswordExpired code (it just receives an invalid password).

 

I think the best way would be exposing one of the local services that check for password expiration (like checkPasswordExpired in UserLocalService) to the UserService and using the remote JSON-WS. That means just adding one row to a service.xml, and call that service before doing login/with a custom interactor. 

Juan Jose Olmos, modified 6 Years ago. New Member Posts: 2 Join Date: 4/18/18 Recent Posts

thank you so much, I guess i'll do it like you suggest it.laugh

UserLocalServiceUtil.isPasswordExpired(user);