Forums de discussion

Auto Login in Liferay portal For Every page

Jimmy Joseph, modifié il y a 12 années.

Auto Login in Liferay portal For Every page

New Member Publications: 13 Date d'inscription: 23/09/11 Publications récentes
Requirement : We have requirement to auto login in liferay portal while accessing EVERY page in portal.
For example,
When user access URL like http://localhost:8080/web/tools then user will auto-login into portal without entering credentials.

Problem : Current scenario is when user go to URL http://localhost:8080 then it will allow user login automatically.
But when user access any page like http://localhost:8080/web/tools then it will not logged in to portal, it just shows page content and user cannot see the Welcome message in dockbar.


Can you please assist for auto login issue?
thumbnail
David H Nebinger, modifié il y a 12 années.

RE: Auto Login in Liferay portal For Every page

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Remove the guest view permission on each page of the portal and login is required (thus invoking auto login).
Jimmy Joseph, modifié il y a 12 années.

RE: Auto Login in Liferay portal For Every page

New Member Publications: 13 Date d'inscription: 23/09/11 Publications récentes
We tried with removing the guest view permission on each page and access URL.
Now it redirected to login page and asks for user's credentials instead of log in automatically to the portal.


Can you please explain details steps to achieve auto login on every page?
thumbnail
David H Nebinger, modifié il y a 12 années.

RE: Auto Login in Liferay portal For Every page

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Auto login only works if the user clicks 'remember me' checkbox during login and never specifically logs out (which clears all of the 'remember me' stuff preventing auto login).

Unless of course you're using NTLM, then that's a different story.
Jimmy Joseph, modifié il y a 12 années.

RE: Auto Login in Liferay portal For Every page

New Member Publications: 13 Date d'inscription: 23/09/11 Publications récentes
Thanks For the quck reply.
But we do not want use NTLM

I found some Post on Liferay forums for implementing AutoLogin interface .
I have created Hook which implementing Auto Login Interface. Please find some code snippet class

public class MyAutoLogin implements AutoLogin {
@Override
public String[] login(HttpServletRequest request,
HttpServletResponse response) throws AutoLoginException {

request.setAttribute(AUTO_LOGIN_REDIRECT, "/c/portal/login");
}
return null;
}
}

But when i deployed on portal it causing infinite loop while accessing Portal URL.

We need to redirect to url "/c/portal/login" when user directly go to any page using URL like "http://localhost:8080/web/tools".

How do we implement AutoLogin interface to redirect it "/c/portal/login" ?
thumbnail
David H Nebinger, modifié il y a 12 années.

RE: Auto Login in Liferay portal For Every page

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Liferay handles all of that already...

If you remove guest privs on a page, Liferay will ask user to log in. After logging in, you can view all pages.

AutoLogin is a different thing in the Liferay world and represents the ability to access a privileged resource allowing for the automatic login rather than the prompting for login info.

You're getting a loop because Liferay is already redirecting there and you're trying to redirect back to yourself.
Jimmy Joseph, modifié il y a 12 années.

RE: Auto Login in Liferay portal For Every page

New Member Publications: 13 Date d'inscription: 23/09/11 Publications récentes
Even guest permission are removed , Liferay will not ask user for Log in
Is this possible ?
thumbnail
David H Nebinger, modifié il y a 12 années.

RE: Auto Login in Liferay portal For Every page

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
So are you really logged in? Does your current theme show some indicator of whether you are a logged in user or not?
Jimmy Joseph, modifié il y a 12 années.

RE: Auto Login in Liferay portal For Every page

New Member Publications: 13 Date d'inscription: 23/09/11 Publications récentes
No, unable to log in portal at all.
It's just showing login screen every time whenever I access any page directly.
thumbnail
David H Nebinger, modifié il y a 12 années.

RE: Auto Login in Liferay portal For Every page

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Okay, I am then not following your line of thinking...

You asked how to force the login to access any page of the portal.

By removing the guest access, this seems to have been accomplished. You are now prompted for the login credentials in order to access the page.

Now you say it is showing the login, but you don't want it to?
Jimmy Joseph, modifié il y a 12 années.

RE: Auto Login in Liferay portal For Every page

New Member Publications: 13 Date d'inscription: 23/09/11 Publications récentes
Yes, We need to allow user directly log in portal if user access any of the page.
User should never-ever see the login screen of portal.
thumbnail
David H Nebinger, modifié il y a 12 années.

RE: Auto Login in Liferay portal For Every page

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
Okay, well you're mixing concepts here...

Logging in, or authenticating, deals w/ ensuring the user is who they claim to be. For this you can leverage a number of SSO options, some with built-in auto login (i.e. NTLM).

If the auto-login is not available or an option (i.e. you are using NTLM but user is connecting from the internet and therefore not part of your Windows network), they will be prompted w/ the login dialog.

Now about protecting resources (pages). By removing the guest access on the pages, you are protecting those pages and requiring user authentication in order to view.

That being said, you have the resources protected properly. The remaining piece is the authentication...

You need to determine how users will be accessing your portal. Then you determine what SSO/auto login capabilities will be available to them. If this is an intranet based application and you're using IE browsers within a Windows network, then you can pursue the Active Directory integration and NTLM auto login capabilities.

If it is any option besides this, you're going to be stuck with some login prompt (whether it is CAS or some other SSO option) as it's the only way to authenticate the user. There will be no way to authenticate users w/ out a login of some kind.
thumbnail
Hemant Behera, modifié il y a 10 années.

RE: Auto Login in Liferay portal For Every page

Junior Member Publications: 36 Date d'inscription: 01/12/09 Publications récentes
Hi David,

I have removed the "guest permission" from Liferay default landing page(i.e. web/guest/home). Now its giving me below error
You do not have permission to view this page.

Your quick response is highly appriciated.
Thanks
Hemant