Foren

Why do we need autologin hook ?

thumbnail
Ganesh Sahu, geändert vor 9 Jahren.

Why do we need autologin hook ?

New Member Beiträge: 5 Beitrittsdatum: 28.10.13 Neueste Beiträge
Can anyone give a usecase when to use a autologin hook ?
thumbnail
Andew Jardine, geändert vor 9 Jahren.

RE: Why do we need autologin hook ?

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
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, geändert vor 9 Jahren.

RE: Why do we need autologin hook ?

New Member Beiträge: 5 Beitrittsdatum: 28.10.13 Neueste Beiträge
Thank you Andrew,
For briefing down the scenario. I will have a look on the source code. "Merry chritmas " emoticon
thumbnail
Andew Jardine, geändert vor 9 Jahren.

RE: Why do we need autologin hook ?

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
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.