RE: Liferay 7.1 GA1: Changing Autologin Order

Jannik Wortmann, modified 7 Years ago. New Member Posts: 2 Join Date: 7/26/16 Recent Posts

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!

thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
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?

Jannik Wortmann, modified 7 Years ago. New Member Posts: 2 Join Date: 7/26/16 Recent Posts

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"