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
Firmi prego dentro per inbandierare questo come inadeguato.