Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Jisha Chandran Kadamkode
Log-in Info from Cookie
29. Januar 2013 03:18
Antwort

Jisha Chandran Kadamkode

Rang: New Member

Nachrichten: 5

Eintrittsdatum: 21. Januar 2013

Neue Beiträge

Dear All,

I am a newbee with Liferay; have been playing with it for only 2 days emoticon Kindly help me and shed some light on my stupid doubt which is as follows:

I have an application running in Tomcat. I have a log-in page corresponding to it. If the log-in is successful; I will get a cookie for my domain name and it will be re-directed to a page which consists of 4 iframes. But since it is an ordinary jsp page; the flexibity to customize the iframes is very limited.

So we would like to use Liferay instead to provide the 4 iframes and allow the users to customize the page as they wish. Is this possible with Liferay? Can I get the authenticated cookie from the log-in page and use the same to authorize and authenticate the users on to the pages in the iframes? If so, kindly guide me on how to go about with this.


Basically I want to by-pass the log-in in the portal and use the information from the cookie from my login.jsp to display the contents on the portal and all the iframe contents should be able to get the cookie too.

Any information on the same will be much appreciated and valued. Thanks a zillion in advance.

Warm Regards,
Jisha
Hitoshi Ozawa
RE: Log-in Info from Cookie
29. Januar 2013 04:26
Antwort

Hitoshi Ozawa

Rang: Liferay Legend

Nachrichten: 7952

Eintrittsdatum: 23. März 2010

Neue Beiträge

Just use Liferay's iframe portlet. Check the following thread on passing username/password:

http://www.liferay.com/community/forums/-/message_boards/message/7340580
Apoorva Prakash
RE: Log-in Info from Cookie
29. Januar 2013 05:06
Antwort

Apoorva Prakash

Rang: Liferay Master

Nachrichten: 659

Eintrittsdatum: 15. Juni 2010

Neue Beiträge

Jisha Kadamkode:
Dear All,

I am a newbee with Liferay; have been playing with it for only 2 days emoticon Kindly help me and shed some light on my stupid doubt which is as follows:

I have an application running in Tomcat. I have a log-in page corresponding to it. If the log-in is successful; I will get a cookie for my domain name and it will be re-directed to a page which consists of 4 iframes. But since it is an ordinary jsp page; the flexibity to customize the iframes is very limited.

So we would like to use Liferay instead to provide the 4 iframes and allow the users to customize the page as they wish. Is this possible with Liferay? Can I get the authenticated cookie from the log-in page and use the same to authorize and authenticate the users on to the pages in the iframes? If so, kindly guide me on how to go about with this.


Basically I want to by-pass the log-in in the portal and use the information from the cookie from my login.jsp to display the contents on the portal and all the iframe contents should be able to get the cookie too.

Any information on the same will be much appreciated and valued. Thanks a zillion in advance.

Warm Regards,
Jisha


Hi Jisha,

I have done some this kind of work, but its kind of risky.

There are two solution:
1. You have to create a Custom Service PreAction and read the cookie there. If you get the cookie, read its value from it (might be email address or userid), fetch the user object, and password also from that user object. Now Call com.liferay.portlet.login.util.loginHttpServletRequest request, HttpServletResponse response, String login, String password, boolean rememberMe, String authType) method with valid parameters.

2. You have to create a custom auto login hook, and supply these value.

Hope this will help.

Thanks and Regards,
Apoorva Prakash
Jisha Chandran Kadamkode
RE: Log-in Info from Cookie
29. Januar 2013 18:17
Antwort

Jisha Chandran Kadamkode

Rang: New Member

Nachrichten: 5

Eintrittsdatum: 21. Januar 2013

Neue Beiträge

Hitoshi Ozawa:
Just use Liferay's iframe portlet. Check the following thread on passing username/password:

http://www.liferay.com/community/forums/-/message_boards/message/7340580


Dear Ozawa,

Thanks a zillion for your quick reply emoticon . I have gone through the post you suggested. But I understand it is to pass the login information from the Liferay login portlet and make it available for the iframes in the portal.

But my requirement is that I have an authentication mechanism for my application and a login page too. This login page runs in another server (login.jsp). If the user is authenticated then the login page will produce a cookie which will available for all the pages in the same domain. Once a user is authenticated he will be re-directed to the liferay portal and all my iframes will be residing there. I need to have my cookie be used for an auto-login to liferay portal and the same cookie to be passed on to the iframes for further authorization.

I will need all the cookie and session properties to be set-up in the properties file mentioned in the post you gave. Thanks again emoticon

Warm Regards,
Jisha
Jisha Chandran Kadamkode
RE: Log-in Info from Cookie
29. Januar 2013 18:36
Antwort

Jisha Chandran Kadamkode

Rang: New Member

Nachrichten: 5

Eintrittsdatum: 21. Januar 2013

Neue Beiträge

Apoorva Prakash:
Hi Jisha,

I have done some this kind of work, but its kind of risky.

There are two solution:
1. You have to create a Custom Service PreAction and read the cookie there. If you get the cookie, read its value from it (might be email address or userid), fetch the user object, and password also from that user object. Now Call com.liferay.portlet.login.util.loginHttpServletRequest request, HttpServletResponse response, String login, String password, boolean rememberMe, String authType) method with valid parameters.

2. You have to create a custom auto login hook, and supply these value.

Hope this will help.

Thanks and Regards,
Apoorva Prakash


Dear Apoorva,

Thanks a zillion emoticon

I think this is what I need. But I am still not very clear on this; pardon my stupidity emoticon

Do you mean to say that I create a service call in my liferay server (something like RESTful service emoticon ) which will decrypt my cookie and read the userId and password from it. Then I use the same to force login action of liferay?

My cookie will be available for all the pages which follow certain domain name pattern. So if I give a similar domain name for my liferay server my cookie should be available there; right? If so, I will have my liferay portal server to have the default url to be my service's and the service will trigger the login call for liferay; right?

In that case, what will be the authentication setting for my portal be? Also, if I login this way will my cookie be available to all the iframes in the portal or do I need to have some other setting for the same?

Thanks again for your timely input. Please enlighten me further with your valuable input.

Warm Regards,
Jisha