Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Daniel Butts
Login redirection problem with Apache and Tomcat
3 de Janeiro de 2012 16:20
Resposta

Daniel Butts

Ranking: New Member

Mensagens: 1

Data de entrada: 3 de Janeiro de 2012

Mensagens recentes

We are using apache and mod_jk to redirect requests on port 80 to Tomcat on port 8080. In order to ensure security, my portlet checks that there is an authenticated user and if there is not, it redirects to the login page. Here is the code that I use in the jsp of my portlet:

<%
if (request.getRemoteUser() == null) {
%>
<script type="text/javascript">
location.replace('/c/portal/login');
</script>
<%
} else {
%>

This redirects to the login page fine and when on the local machine, authentication works normally. However when browsing to Liferay from the Internet (http://myserver.mydomain.com/web/guest/home) the form target of the login page and the URL of the "Return to Full Page" link are http://localhost:8080/web/guest/home.

Liferay appears to be using the absolute url of where it is hosted in Tomcat rather than a relative url. Where have we gone wrong?

Thanks
Ravi Kumar Gupta
RE: Login redirection problem with Apache and Tomcat
3 de Janeiro de 2012 21:03
Resposta

Ravi Kumar Gupta

Ranking: Liferay Legend

Mensagens: 1303

Data de entrada: 23 de Junho de 2009

Mensagens recentes

I faced this problem.. See this post http://www.liferay.com/community/forums/-/message_boards/message/6895116

Let me know if this solves your problem..