Nothing can be simpler than implementing AutoLogin and Custom Authenticator in Liferay. Following is the "How-To"
- Create a Hooks Project
- Put the following properties in portal.properties file in your hooks project
- auth.pipleline.pre=com.mslc.authenticators.EMMAuthenticator
- auto.login.hooks=com.mslc.authenticators.EMMAutoLogin
- auto.login.ignore.paths=/web/guest.home (optional)
- Then create the classes configured
- EMMAuthenticator must implement com.liferay.portal.security.auth.Authenticator
- EMMAutoLogin must implement com.liferay.portal.security.auth.AutoLogin
- EMMAuthenticator must return an int. If it returns Authenticator.SUCCESS then the authentication is passed or else if it returns Authenticator.FAILURE then it has failed.
- EMMAutoLogin must return a String[]. The array must contain 3 elements
- userId
- password
- true or false (string format ofcourse) to indicate whether the password is encrypted or not
No comments:
Post a Comment