Auto Login : Auto login is a feature that allows you to login automatically!
Few of available Auto Login types in Liferay 7 \ Liferay DXP :
- Basic Authentication
- Request Header
- Parameter
- Remember Me
Basic Authentication Header Auto Login
To know about basic authentication, please follow this link.
Basic authentication[username + password] can be passed in headers for auto login.
Create a config file named "com.liferay.portal.security.auto.login.basic.auth.header.module.configuration.BasicAuthHeaderAutoLoginConfiguration.cfg".
enabled=true
To deploy, copy corresponding [.cfg] \ config file to osgi/config or osgi/modules folder.
You can test it through postman like utilities!
Request Header Auto Login
It requires screen name in request header, header key name would be - "LIFERAY_SCREEN_NAME"
Config file > "com.liferay.portal.security.auto.login.request.header.module.configuration.RequestHeaderAutoLoginConfiguration.cfg".
We need to make host entries of valid IP's.
enabled=trueauthHostsAllowed=127.0.0.1,SERVER_IP
Test it in similar manner as Basic Authentucation Auto Login.
Request Parameter Auto Login
For parameter auto login, append these parameters in URL
"?parameterAutoLoginLogin=test@liferay.com¶meterAutoLoginPassword=test"
If you use
"/c/portal/login?parameterAutoLoginLogin=test@liferay.com¶meterAutoLoginPassword=test "
then it will redirect you to default landing page as well.
Config file > "com.liferay.portal.security.auto.login.request.parameter.module.configuration.RequestParameterAutoLoginConfiguration.cfg".
enabled=true
To create custom AutoLogin : https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/auto-login#creating-an-auto-login-component
You can also enable\disable\update auto login settings from control panel > Configuration > System Settings > Foundation > [search login]
Note: If you’re running Liferay DE 7.0 Fix Pack 7 or earlier, or Liferay CE Portal 7.0 GA3 or earlier, System Settings exports a .cfg file instead of a .config file. The file format was changed to fix a bug with multi-value settings, which the .cfg format didn’t handle properly. See the bug report for more information. Any Liferay Portal system newer than those listed in this note uses the .config file format.
You are just done, Try & Enjoy the function.............:)