Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Biswajit Das
Auto Login in Liferay portal For Every page
30 mars 2012 04:29
Réponse

Biswajit Das

Rang: New Member

Publications: 13

Date d'inscription: 23 septembre 2011

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?
David H Nebinger
RE: Auto Login in Liferay portal For Every page
30 mars 2012 05:15
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11511

Date d'inscription: 1 septembre 2006

Publications Récentes

Remove the guest view permission on each page of the portal and login is required (thus invoking auto login).
Biswajit Das
RE: Auto Login in Liferay portal For Every page
30 mars 2012 06:18
Réponse

Biswajit Das

Rang: New Member

Publications: 13

Date d'inscription: 23 septembre 2011

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?
David H Nebinger
RE: Auto Login in Liferay portal For Every page
30 mars 2012 06:24
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11511

Date d'inscription: 1 septembre 2006

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.
Biswajit Das
RE: Auto Login in Liferay portal For Every page
30 mars 2012 07:22
Réponse

Biswajit Das

Rang: New Member

Publications: 13

Date d'inscription: 23 septembre 2011

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" ?
David H Nebinger
RE: Auto Login in Liferay portal For Every page
30 mars 2012 08:04
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11511

Date d'inscription: 1 septembre 2006

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.
Biswajit Das
RE: Auto Login in Liferay portal For Every page
2 avril 2012 00:07
Réponse

Biswajit Das

Rang: New Member

Publications: 13

Date d'inscription: 23 septembre 2011

Publications Récentes

Even guest permission are removed , Liferay will not ask user for Log in
Is this possible ?
David H Nebinger
RE: Auto Login in Liferay portal For Every page
2 avril 2012 06:12
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11511

Date d'inscription: 1 septembre 2006

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?
Biswajit Das
RE: Auto Login in Liferay portal For Every page
2 avril 2012 06:39
Réponse

Biswajit Das

Rang: New Member

Publications: 13

Date d'inscription: 23 septembre 2011

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.
David H Nebinger
RE: Auto Login in Liferay portal For Every page
2 avril 2012 07:33
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11511

Date d'inscription: 1 septembre 2006

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?
Biswajit Das
RE: Auto Login in Liferay portal For Every page
2 avril 2012 21:01
Réponse

Biswajit Das

Rang: New Member

Publications: 13

Date d'inscription: 23 septembre 2011

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.
David H Nebinger
RE: Auto Login in Liferay portal For Every page
3 avril 2012 06:11
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11511

Date d'inscription: 1 septembre 2006

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.
Hemant Behera
RE: Auto Login in Liferay portal For Every page
15 juillet 2013 12:05
Réponse

Hemant Behera

Rang: Junior Member

Publications: 35

Date d'inscription: 1 décembre 2009

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