Fórum

Why do we need autologin hook ?

thumbnail
Ganesh Sahu, modificado 9 Anos atrás.

Why do we need autologin hook ?

New Member Postagens: 5 Data de Entrada: 28/10/13 Postagens Recentes
Can anyone give a usecase when to use a autologin hook ?
thumbnail
Andew Jardine, modificado 9 Anos atrás.

RE: Why do we need autologin hook ?

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Hi Ganesh,

There are a lot of cases where this is applicable -- the most general answer would be anytime a user has authenticated in another system and you don't want to challenge them for credentials to access Liferay.

One of my past projects required integration with a third party service for authentication. The hooks the login process in Liferay and when the user entered their credentials we called the third party service to validate the details. If the results were successful, then we pushed the user to the auto login hook which would look up their user record and log them into Liferay automatically. Remember, even though a user is authenticated elsewhere, when they are in Liferay they require a Liferay User context to leverage features like permissions, preferences, etc.

There are serveral auto login hooks offered by Liferay out of the box -- all of them relating to authentication "outside Liferay". Just do class search for *AutoLogin on the Liferay source and have a look -- I think the reason will become obvious pretty quickly.
thumbnail
Ganesh Sahu, modificado 9 Anos atrás.

RE: Why do we need autologin hook ?

New Member Postagens: 5 Data de Entrada: 28/10/13 Postagens Recentes
Thank you Andrew,
For briefing down the scenario. I will have a look on the source code. "Merry chritmas " emoticon
thumbnail
Andew Jardine, modificado 9 Anos atrás.

RE: Why do we need autologin hook ?

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
No problem Ganesh -- same to you. Don't hesitate to add more discussion to this thread if you have any additional questions about the hooks.