0

ParameterAutoLogin example

  • Asked - May 24, 2010, 03:20 PM
    / Viewed 58228 Times
    Hi,

    I am new to liferay and I would like to know how can I use ParameterAutoLogin.java. If I append parameterautologinlogin and parameterautologinpassword to the request url, will it call the ParameterAutologin.java and the user is logged in automatically?

    I would be thankful if I get the responses quickly.

    Regards,
    Pratima

    1 Answers

    0
    Answered - May 25, 2010, 03:53 AM
    (Edited)
    yes
    Make sure your portal-ext.properties has this class specified in auto.login.hooks
    
    auto.login.hooks=com.liferay.portal.security.auth.CASAutoLogin,com.liferay.portal.security.auth.NtlmAutoLogin,com.liferay.portal.security.auth.OpenIdAutoLogin,com.liferay.portal.security.auth.OpenSSOAutoLogin,com.liferay.portal.security.auth.RememberMeAutoLogin,com.liferay.portal.security.auth.SiteMinderAutoLogin,com.liferay.portal.security.auth.ParameterAutoLogin
    


    But it has to parameterAutoLoginLogin and parameterAutoLoginPassword
    Its case sensitive.

    Also plz check what is company.security.auth.type in your portal.properties, if its emailaddress you have to pass emailaddress as parameterAutoLoginLogin parameter, better u change it to screenname in the property and pass screenname instead

    Regards,
    Sandeep
    Replied - May 25, 2010, 12:56 PM
    (Edited)
    Thanks Sandeep,

    However, the ParameterAutoLogin is not getting called. Below are the steps that I am doing.

    1. I have mentioned the auto login hook property in portal-ext.properties


    2. In my struts portlet on an action I prepare a URL with c/portal/login and append the parameters parameterAutoLoginLogin and parameterAutoLoginPassword and open a new window with this URL.

    3. But my parameter auto login is not called.

    could you please tell me where am I doing a mistake.?

    Regards,
    pratima
    Replied - May 25, 2010, 05:06 PM
    (Edited)
    Hi,

    It works fine for me.

    I mentioned following in portal-ext.properties, note have added ParameterAutoLogin at the end

    auto.login.hooks=com.liferay.portal.security.auth.CASAutoLogin,com.liferay.portal.security.auth.NtlmAutoLogin,com.liferay.portal.security.auth.OpenIdAutoLogin,com.liferay.portal.security.auth.OpenSSOAutoLogin,com.liferay.portal.security.auth.RememberMeAutoLogin,com.liferay.portal.security.auth.SiteMinderAutoLogin,com.liferay.portal.security.auth.ParameterAutoLogin


    Restarted the server and hit the following url

    http://localhost:8080/web/guest?parameterAutoLoginLogin=test@liferay.com&parameterAutoLoginPassword=test

    And i was logged in automatically.

    Regards,
    Sandeep
    Replied - May 16, 2012, 06:08 AM
    (Edited)
    Hi all,

    Do wee need to add that ParameterAutoLogin hook in the servers portlet-ext properties only. i tried it but not auto loging.
    can u just ellobrate more on it.

    Regards,
    Zoheb.S
    Replied - May 16, 2012, 08:39 AM
    (Edited)
    Hi,

    it worked thanks...

    Thanks and Regards,
    Zoheb S
    Replied - May 21, 2012, 10:20 AM
    (Edited)
    Hi Sandeep,

    i had tried ParameterAutoLogin for autologin into liferay , with your help i was able to login into liferay login i, but i need help in logout the user from liferay .
    i am not show dockbar to our normal user so he cant click on signout link can we destroy session of user when we get parameter from external application into portal_normal like
    this
    #set ($logout = $request.getParameter("signout"))
    #if($logout == "true")
    calling logout action class
    #end
    Replied - Jan 23, 2013, 10:44 AM
    (Edited)
    Sandeep Nair:
    Hi,

    It works fine for me.

    I mentioned following in portal-ext.properties, note have added ParameterAutoLogin at the end

    auto.login.hooks=com.liferay.portal.security.auth.CASAutoLogin,com.liferay.portal.security.auth.NtlmAutoLogin,com.liferay.portal.security.auth.OpenIdAutoLogin,com.liferay.portal.security.auth.OpenSSOAutoLogin,com.liferay.portal.security.auth.RememberMeAutoLogin,com.liferay.portal.security.auth.SiteMinderAutoLogin,com.liferay.portal.security.auth.ParameterAutoLogin


    Restarted the server and hit the following url

    http://localhost:8080/web/guest?parameterAutoLoginLogin=test@liferay.com&parameterAutoLoginPassword=test

    And i was logged in automatically.

    Regards,
    Sandeep



    Hey Sandeep,
    Thanks a ton. Have been looking for it for quite some time. Works amazingly. Though the user name and pass is exposed on the next screen. Can we mask the same??
    Replied - Sep 23, 2013, 04:07 PM
    (Edited)
    For people using Liferay 6.1.X
    Read this thread:
    AutoLogin not working in 6.1 GA2

    Where recommend to put:
    live.users.enabled=false
    To avoid a bug.
    Replied - Nov 22, 2013, 12:02 PM
    (Edited)
    Hi,

    Using 6.1.1 CE

    I have default landing page /web/guest/home set for the portal.

    Now I am using Parameter Auto login....I want to use a different landing page (web/guest/parampage) for this.

    So basically have two landing pages..one for the normal user who signs in.....and one for the user who are signed in using parameter parameters.

    How can this be done?