0
votes

I'm working with liferay and implemented cas+ldap and it is working fine in the server, now I got a question, how can I create a portlet to redirect to an external URL and use the same user who was authenticated in liferay?

I tried

public class gotoURL extends MVCPortlet throws IOException {   
    private String sessionID = null;

    public void addDetails(ActionRequest request, ActionResponse response) {
        Cookie[] c =request.getCookies();
        for(int i =0;i<c.length;i++){                   
            if(c[i].getName().equals("JSESSIONID")){
                sessionID = c[i].getValue();
            }
        }       
        response.encodeURL("my_external_web");      
        response.sendRedirect("my_external_web");           
    }
}

i've also tried to make an iFrame into the liferay portal and pass the @screen_name@ and @password@ but it did't work(the another web is http and have a captchat).

Can i pass the jsessionid or similar to authenticate in another web page without have access to modify that application or i need to modifiy the external web page? in this case, what i need to add in the external web? Thanks!

1

1 Answers

0
votes

To answer your question:

Can i pass the jsessionid or similar to authenticate in another web page without have access to modify that application or i need to modifiy the external web page?

That actually depends.When you say an external URL,are you referring to an external application on the same web server or a different web server.It is possible on same web server,provided the jsession id configuration is done correctly on the server end.

in this case, what i need to add in the external web?

Considering you are interacting with an application on a different server,you need to set up some mechanism such as OAuth to authenticate user on different application