Fórumok

Integrating login functionality for portlet widgets

thumbnail
Stian Sigvartsen, módosítva 11 év-val korábban

Integrating login functionality for portlet widgets

Regular Member Bejegyzések: 103 Csatlakozás dátuma: 2010.08.27. Legújabb bejegyzések
I have a requirement to place a portlet on an external web application available on a completely different domain to our Liferay portal. For this I am exploring the "share" >> "any website" feature provided for all portlets. This works great for the most part and the user's permissions are taken into account. However, this becomes a problem when the user is not logged into Liferay Portal. i.e. the portlet renders only guest viewable content.

Is there an easy way to integrate login functionality when portlets are rendered as widgets?
Any guidance would be very appreciated.

-Stian
Florin Tintea, módosítva 9 év-val korábban

RE: Integrating login functionality for portlet widgets

New Member Bejegyzések: 2 Csatlakozás dátuma: 2014.12.19. Legújabb bejegyzések
I have the same problem. I can share the portlet and embed it into another website but it requires to be a specific user / have a specific role, so it shoud ask for credentials first. Have you found any solution?
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: Integrating login functionality for portlet widgets

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Seriously? How much control do you expect Liferay to have over some other site/server/whatever?
thumbnail
Stian Sigvartsen, módosítva 9 év-val korábban

RE: Integrating login functionality for portlet widgets

Regular Member Bejegyzések: 103 Csatlakozás dátuma: 2010.08.27. Legújabb bejegyzések
Hi Florin

The solution which worked best for me in the end was to create a custom portlet content embedding approach. i.e. not using "share" >> "any website", which gives you a HTML snippet which ultimately places an iFrame into your page.

My custom approach was to use JQuery to embed content produced by a custom view mode on my portlet. I called it the "preview" mode, and I used the Liferay Friendly URLs framework to achieve a predictable URL for requesting embeddable content via this mode. URLs were of the form https://yourportal.com/web/somesite/somepage/-/portletName/preview . Please note that the portlet has to be non-instantiable to achieve such URLs.

The content produced by my portlet for embedding was just guest viewable content + a link to view more details. The link when clicked would take the user to the Liferay Portal where s/he would be asked to log in if not already logged in. Quite simple really, but worked pretty nicely.

If you really need to embed content that should only be visible to a logged in user then there are ways to achieve this, but it is a bit more complicated. Happy to explore a solution with you but let me know if it's necessary before i do emoticon

-Stian
thumbnail
Robin Nagpal, módosítva 9 év-val korábban

RE: Integrating login functionality for portlet widgets

Junior Member Bejegyzések: 44 Csatlakozás dátuma: 2014.11.18. Legújabb bejegyzések
Stian Sigvartsen:


Is there an easy way to integrate login functionality when portlets are rendered as widgets?
Any guidance would be very appreciated.

-Stian


May be you can try embedding login portlet in your own portlet which you have exposed as widget. Show the login portlet when user is not logged in
thumbnail
Stian Sigvartsen, módosítva 9 év-val korábban

RE: Integrating login functionality for portlet widgets

Regular Member Bejegyzések: 103 Csatlakozás dátuma: 2010.08.27. Legújabb bejegyzések
Robin Nagpal:
May be you can try embedding login portlet in your own portlet which you have exposed as widget. Show the login portlet when user is not logged in


Hi Robin. Do you have any thoughts on the approach you would take for embedding the login portlet into the custom portlet and handling all the login portlet requests properly? Would you suggest extending the login portlet's class in order to achieve this?

-Stian