Liferay : Redirect to change Password after auto login

saylee

I wanted a functionality wherein when I create a user for the first time I give an auto login url for that user in the user creation mail in Liferay.

In my Auto Login implementation I checked whether the user has loggedin for the first time or not. If it is a first time login, the user is authenticated automatically and if not the portal's login page is seen. I have been successful doing this.

But now what I want is that once auto logged in the user is redirected to portal's reset password page. In which event this can be done correctly (In which event to set the hook.) and what is the portal's redirection url? Any help would be appreciated.

Thanks in advance.

saylee

Finally, I got it working.

I just needed to set the password reset of the Liferay user to true whenever I found out that the user's password modified date as null in the auto login implementation. Liferay's PortalRequestProcessor has an internal logic to return to update password page if it sees the user's passwordReset flag as true.

public class MyAutoLogin implements AutoLogin
{
    @Override
    public String[] login(HttpServletRequest request, HttpServletResponse response) throws AutoLoginException
    {
        //Get user details from auto Login request params

        if (null == user.getPasswordModifiedDate())
        {
            user.setPasswordReset(true);
            return credentials;
        }
        return null;
    }

}

By returning credentials inside the if condition I ensured that Auto Login is enabled only for those users who have not changed their password even once post their account creation on Liferay.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Redirect after login fail in Liferay

From Dev

Redirect to Login page after successful reset password

From Dev

Automatic Login Via Devise after Password Change

From Dev

Can not login to mysql 5.7.9 after change password

From Dev

Logout and redirect user back to login blade with a message on change password in laravel

From Dev

Liferay portlet doView() after redirect

From Dev

Auto logout/destroy session after Password Change in Django

From Dev

Devise ..After first login should ask for change password

From Dev

Can't login in Fedora 20 (VM) to KDE after password change

From Dev

Unable to login after password change, having home directory encrypted

From Dev

Is there a way to "auto login" in PuTTY with a password?

From Dev

redirect after login on login dialog

From Dev

Magento redirect after login

From Dev

Spree redirect after login

From Dev

ring redirect after login

From Dev

MVC Redirect after login

From Dev

How to redirect after login

From Dev

Redirect to a servlet after login?

From Dev

Magento redirect after login

From Dev

Auto Login after Registration

From Dev

Require Password after Login

From Dev

login hang after password

From Dev

Liferay login portlet display text change

From Dev

How to redirect the user to login page after sending password reset instructions in rails 3 using devise

From Dev

In liferay, how do I redirect to the login page and back?

From Dev

Liferay redirect to user's entered page post login

From Dev

Change Customer Login Password in Magento

From Dev

Django Redirect after Successful Login

From Dev

Devise After first login redirect