Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Auto Login
Hello,I'm trying to create a CASAutoLogin service replacement for Liferay 7.2 (adding insert/update users support) and followed the instructions on https://portal.liferay.dev/docs/7-2/frameworks/-/knowledge_base/f/auto-login. The jar deploys fine, but the service doesn't seem to be used by Liferay. In older Liferay versions you would have added a plugin-hook.xml to configure the auto.login.hooks property. Is this still required in 7.2, and if yes, how do I configure this in a proper OSGi bundle instead of a war?Thanks.
Thanks. I already found the original CASAutoLogin code. The problem is that deploying this isn't enough.The class name needs to be added to the auto.login.hooks property too, but I don't know how to do that in an Osgi bundle.
this property may help youhttps://github.com/liferay/liferay-portal/blob/master/portal-impl/src/portal.properties#L3992
Yes, that property. The problem is with the remark from the description: This property is not read by the portal except for portal properties overridden by liferay-hook.xml. It remains here only as a reference.
I got the hook working now to set the auto.login.hooks property to my CASAutoLogin class.In previous Liferay versions (6) setting auto.login.hooks to a single class name implied that only that class should be loaded.The problem is that now Liferay is using OSGi services the already loaded AutoLogin services are not unloaded and my class in only appended to the list.This means the original CASAutoLogin executes first, which causes my own CASAutoLogin to fail.Is there any way to disable all other AutoLogin services or to get my CASAutoLogin class to load first?
You can stop cas impl service and try
com.liferay.portal.security.sso.cas.api
com.liferay.portal.security.sso.cas.impl
Also there is concept of service ranking you can refer that also
https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/creating-a-custom-osgi-service
com.liferay.portal.security.sso.cas.api
com.liferay.portal.security.sso.cas.impl
Also there is concept of service ranking you can refer that also
https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/creating-a-custom-osgi-service
You can also blacklist bundles
https://portal.liferay.dev/docs/7-0/user/-/knowledge_base/u/blacklisting-osgi-modules
Blacklisting the impl bundle should work. But I didn't try it.
https://portal.liferay.dev/docs/7-0/user/-/knowledge_base/u/blacklisting-osgi-modules
Blacklisting the impl bundle should work. But I didn't try it.
Hi,
If you got it working can you please tell me how you did it?
I'm facing with an "Unresolved requirement: Import-Package: com.liferay.portal.security.sso.cas.internal.auto.login.. " error
Regards,
Mircea
If you got it working can you please tell me how you did it?
I'm facing with an "Unresolved requirement: Import-Package: com.liferay.portal.security.sso.cas.internal.auto.login.. " error
Regards,
Mircea
So I assume you are extending the original CASAutoLogin? My code doesn't extend CASAutoLogin; I created my own AutoLogin service (based on the CASAutoLogin code from Liferay).
However, I abandoned this approach. Instead, I've now created my own UserImporter service (because the LDAP import was the only part of CASAutoLogin that I wanted to change).
However, I abandoned this approach. Instead, I've now created my own UserImporter service (because the LDAP import was the only part of CASAutoLogin that I wanted to change).
Yes, that's what I tried to do. That's how is currently done in our Liferay 6 deployment. But I think it would be easier for me to also create a UserImporter service because the only thing missing is the roles sync between Liferay and our custom LDAP tree. Thank you!
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™