is it feasible to open a dummy page and close it immediately to get authentication cookie

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
6/2/2013 5:54:18 PM
Gravatar
Total Posts 27

is it feasible to open a dummy page and close it immediately to get authentication cookie

Here is the problem I want to solve: I have a 3rd party Tomcat application. The application allows login using http api, e.g.

http://server1/jasperserver/flow.html?_flowId=searchFlow&j_username=xxxx&j_password=yyyy. After this login, an authentication cookie will be saved somewhere to the web browser. Thus the other pages will not need the login info as long as the browser is open. I am trying to integrate this app with MojoPortal, both of them use LDAP. Originally I tried the following approach in the UserSignInEventHandler, it failed to save the authentication cookie for whatever reason.

          string requestLoginResult = httpclient.UploadString("http://server1/jasperserver/flow.html?_flowId=searchFlow&j_username=xxxx&j_password=yyyy", "GET");     
            string session = httpclient.ResponseHeaders.Get("Set-Cookie");
            System.Web.HttpCookie myCookie = new System.Web.HttpCookie("Cookie", session);
            HttpContext.Current.Response.AppendCookie(myCookie);

So I came out another approach. Add an iframe content with 0 pixel height to the Home page, set the iframe url to the above login page. Set the frame content security to authenticated user. In this way, when user log into Mojo, it automatically log in to jasperserver. But there are two problems here: 1) A shared user has to be used since there is no way to plug in each mojo user's user name and password. 2) Even though the iframe is not showing due to 0 height, but from firebug, one can easily see the DOM window url with userid and password. 1) is ok, but 2) is a security concern. My question is:

--Do anyone know how to get the authentication cookie from response and save it to Mojo's session so that 3rd party application login is bypassed?

--Is there any way in MojoPortal to open a page (e.g. the above 3rd party login page) and immediately close it agter getting the authentication cookie so that the login url with password will not be seen from firebug?

6/3/2013 12:46:36 PM
Gravatar
Total Posts 18439

Re: is it feasible to open a dummy page and close it immediately to get authentication cookie

no there isn't

You must sign in to post in the forums. This thread is closed to new posts.