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: Liferay 7.1 GA1: Changing Autologin Order
Hi,
I developed a AutoLogin component to authenticate with our CAS server. It is basically like the integrated CASAutoLogin, but with some special twists to comply with our needs. It would work like intended, but the order in which the Portal calls the different AutoLogin components alters the request.
Our component gets called always after the default CASAutoLogin. CASAutoLogin fails (which is fine) and calls the doHandleException method, which contains following code:
HttpSession session = request.getSession();
if (e instanceof NoSuchUserException) {
session.removeAttribute(CASWebKeys.CAS_LOGIN);
session.setAttribute(
CASWebKeys.CAS_NO_SUCH_USER_EXCEPTION, Boolean.TRUE);
}
The method removes the login attribute which is crucial for my AutoLogin component.
Is there a way to change the excecution order or a other way to resolve this?
Thank you!
Jannik Wortmann:Our component gets called always after the default CASAutoLogin. CASAutoLogin fails (which is fine) and calls the doHandleException method, which contains following code:
Have you tried blacklisting the default CASAutoLogin component, following the instructions in the Blacklisting OSGi Modules and Components guide?
Thank you, good idea! It works :)
I created com.liferay.portal.component.blacklist.internal.ComponentBlacklistConfiguration.config in osgi/configs with following content:
blacklistComponentNames="com.liferay.portal.security.sso.cas.internal.auto.login.CASAutoLogin"