Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Cristian Serban
Iframe logout action
November 7, 2011 11:41 PM
Answer

Cristian Serban

Rank: New Member

Posts: 14

Join Date: September 5, 2011

Recent Posts

Hi,

I have the following scenario:
- in an iframe portlet the user is logged in with it's current credentials to an other web application - work well
- when the user signs out the iframe portlet doesn't refresh (i mean it makes a refresh but with it previous credentials) - so the iframe portlet is able to connect and authenticate to external web app.

What i want is that when a user make a sign out, the iframe portlet also issues a sign out on the external web app or refreshes with the new empty credentials.

Any ideas? pls help.
biswajit sarkar
RE: Iframe logout action
October 11, 2012 9:50 AM
Answer

biswajit sarkar

Rank: Regular Member

Posts: 166

Join Date: October 17, 2011

Recent Posts

Cristian Serban:
Hi,

I have the following scenario:
- in an iframe portlet the user is logged in with it's current credentials to an other web application - work well
- when the user signs out the iframe portlet doesn't refresh (i mean it makes a refresh but with it previous credentials) - so the iframe portlet is able to connect and authenticate to external web app.

What i want is that when a user make a sign out, the iframe portlet also issues a sign out on the external web app or refreshes with the new empty credentials.

Any ideas? pls help.




I also face the same problem....
anyone aware of this problem???
please help
biswajit sarkar
RE: Iframe logout action
October 11, 2012 12:17 PM
Answer

biswajit sarkar

Rank: Regular Member

Posts: 166

Join Date: October 17, 2011

Recent Posts

please help emoticonemoticon
biswajit sarkar
RE: Iframe logout action
October 16, 2012 9:40 PM
Answer

biswajit sarkar

Rank: Regular Member

Posts: 166

Join Date: October 17, 2011

Recent Posts

any idea...... emoticon
biswajit sarkar
RE: Iframe logout action
October 17, 2012 3:00 AM
Answer

biswajit sarkar

Rank: Regular Member

Posts: 166

Join Date: October 17, 2011

Recent Posts

please help
Christoph Rabel
RE: Iframe logout action
October 17, 2012 4:14 AM
Answer

Christoph Rabel

Rank: Regular Member

Posts: 151

Join Date: September 24, 2009

Recent Posts

Since the iframe doesn't know that the user isn't authenticated anymore, it has to be told from the outside. There is no real good way to solve this without notifying the
You could put some javascript on the page with the iframe, that checks at regular intervals if the user still authenticated. If no, reload the page or just the iframe.

Pseudo javascript code:
function reloadFrameAtLogout () {
if(!isAuthenticated()) iframeWindow.location="Someurl";

setTimeout("reloadFrameAtLogout ()", 1000);
}

You have a few options for isAuthenticated, e.g.:
a) Set a cookie at login, destroy it at logout: Read that cookie in isAuthenticated. If it is there, user is still logged in. This option is not very safe, but will probably work in most scenarios and is very fast.

b) Make an ajax call to some protected url. When the request fails, you are not authenticated anymore. Very safe, but generates a lot of requests.

You can probably also combine these options: Test the cookie every couple of seconds and do a full test with an ajax call every minute or so.