Foren

CustomAutoLogin redirect to external web application

Jainthra Fernandes, geändert vor 12 Jahren.

CustomAutoLogin redirect to external web application

New Member Beitrag: 1 Beitrittsdatum: 13.10.11 Neueste Beiträge
Liferay 5.2.3
App Server = Websphere
I have developed a custom hook to perform AutoLogin.

I want to redirect to enterprise web-application login screen when a certain attribute is null in the session

I am trying to set the following.

	if(user == null){
				System.out.println("### Redirecting ");
   			        req.setAttribute(AutoLogin.AUTO_LOGIN_REDIRECT, "http://<server>/login.do"); 
				return null;				
	}
</server>

However this is not redirecting?

Should I be throwing a exception?
thumbnail
Sandeep Nair, geändert vor 12 Jahren.

RE: CustomAutoLogin redirect to external web application

Liferay Legend Beiträge: 1744 Beitrittsdatum: 06.11.08 Neueste Beiträge
Hi,

Can you place a debug at AutoLoginFilter at the following lines

String redirect = (String)request.getAttribute(
						AutoLogin.AUTO_LOGIN_REDIRECT);

					if (Validator.isNotNull(redirect)) {
						response.sendRedirect(redirect);

						return;
					}


Ideally when you set the redirect attribute in request it should go to the AutoLoginFilter and execute the above code and then redirect

Regards,
Sandeep