Tribune

Home » Liferay Portal » English » 2. Using Liferay » General

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Saravanan V
Filter Issue
1 aprile 2010 12.34
Risposta

Saravanan V

Punteggio: New Member

Messaggi: 11

Data di Iscrizione: 19 marzo 2010

Messaggi recenti

Hi,

I have implmented CAS Authentication in my Liferay Portal,
I want to redirect Users request to /c/portal/login, Any unauthenticated user access portal url request like (http://../liferaypage) should take the user to the /c/portal/login url.

URL which ends with /login need to display load the same url all other unauthenticated users need to be redirect to /c/portal/login which has CAS implementation,

TO implement the same, i have written new filter which will look for URL whether it ends with /login or else manually filter redirect it to the /c/portal/login.

Here my problem is,

problem 1: In Liferay we have many urls to render layout settings, jsps, images, and other things from DB, where because of my filter url's are getting redircetd to the /c/portal/login, since i check for urls which ends with /login where other urls goes in to the condition by default.

problem 2: my condition getting applied for authenticated users, even if any user authenticates with the direct login URL, Again user is falling in problem 1.

To avoid this issue, i have applied few filters but it doesn not help me.

filter for User Auth:
1.) Long userId1 = (Long)request.getSession().getAttribute("USER_ID");
2.) long userId = PortalUtil.getUserId(request);
3.)
String userName = null;
HttpSession session = request.getSession();
userName = (String) session.getAttribute("j_username");

but above declarations doesnt help me to get the user details in the filter.

filter for URLs:
if (!completeURL.endsWith(_EXT_LOGIN)||
!completeURL.endsWith(_EXT_C) || !completeURL.endsWith(_EXT_CSS) ||
!completeURL.endsWith(_EXT_GIF) || !completeURL.endsWith(_EXT_IMAGE_COMPANY_LOGO) ||
!completeURL.endsWith(_EXT_ICO) || !completeURL.endsWith(_EXT_JS) ||
!completeURL.endsWith(_EXT_JPEG) || !completeURL.endsWith(_EXT_JSP) ||
!completeURL.endsWith(_EXT_PORTAL_LAYOUT) || !completeURL.endsWith(_EXT_PORTAL_LOGIN) ||
!completeURL.endsWith(_EXT_PORTAL_LOGOUT) || !completeURL.endsWith(_EXT_PNG)||
!completeURL.endsWith(_PATH_HTML) || !completeURL.endsWith(_PATH_IMAGE) ||
!completeURL.endsWith(_PATH_LANGUAGE) || !completeURL.endsWith(_PATH_SITEMAP_XML) ||
!completeURL.endsWith(_PATH_SOFTWARE_CATALOG) || !completeURL.endsWith(_PATH_WAP) ||
!completeURL.endsWith(_PATH_WSRP))

I checked for the above urls patterns which ends with, but still i didnt get the page with layouts, templates.

please help me, if you know any API/Filters in liferay which filters other then /login URL's and redirect to our custom link (or) /c/portal/login link.

I am sorry, if i have confused you!!!

Thanks,
Saravanan
Wilson Man
RE: Filter Issue
1 aprile 2010 13.00
Risposta

Wilson Man

LIFERAY STAFF

Punteggio: Liferay Master

Messaggi: 580

Data di Iscrizione: 21 giugno 2006

Messaggi recenti

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

Please read the forum guidelines above. Please do not post the same message boards post more than once in different categories.

your other post is found here: http://www.liferay.com/community/forums/-/message_boards/message/4813325
Saravanan V
RE: Filter Issue
1 aprile 2010 20.27
Risposta

Saravanan V

Punteggio: New Member

Messaggi: 11

Data di Iscrizione: 19 marzo 2010

Messaggi recenti

Hi Wilson,

I am sorry, i will avoid the same in future,
and i will delete all my posts from Development category.

Thanks,
Saravanan