Results 1 to 7 of 7
  1. #1
    sakshi.13agg is offline Member
    Join Date
    Sep 2011
    Posts
    14
    Rep Power
    0

    Default Share http session between desktop login and web browser login to web application

    Hello,

    I have an architecture in which we have a windows integration client which connects to web server(Tomcat) and creates http session on login.
    We can also connect to this server through web browser login.

    I have a requirement in which if I am currently logged in to server with windows client and try to hit the web browser login page then I should automatically get login to the same user without showing the login dialogue.

    Can any one help?

    Regards,
    Sakshi

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,586
    Rep Power
    23

    Default Re: Share http session between desktop login and web browser login to web application

    Would a proxy server help? If all browsers on a PC went through a proxy server on the same PC, it could control what is returned to each browser.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    farrukh is offline Member
    Join Date
    Aug 2012
    Posts
    13
    Rep Power
    0

    Default Re: Share http session between desktop login and web browser login to web application

    If I understood it correctly, your desktop client establishes a connection to your webserver (using something like URLConnection), sends the credentials to the server and gets authenticated.
    You basically either need to authenticate client based on IP Address ( which can be problematic depending on the network configurations at client side like proxies and susceptible to IP Spoofing) Or You need find a way to share the desktop client session with other user agents like web browser. The only approach i can think of is use cookieManager(or java or something equivalent) and manually create cookie file for your browser(s) with the same JSESSIONID as for your client. This is definitely not an ideal solution but hopefully will achieve what you need.
    Alternatively, similar to what Norm suggested, You can use something like WebScarab to intercept http request, modify it to include session information and send it across to the server.

  4. #4
    sakshi.13agg is offline Member
    Join Date
    Sep 2011
    Posts
    14
    Rep Power
    0

    Default Re: Share http session between desktop login and web browser login to web application

    Farukh,
    I think using WebScarab will require to install it on machine...which I don't feel will be a good option for this environment.

    So I was trying to use JSESSION ID concept in which I will get the JSESSION ID from my desktop client connection and will send as url parameter to browser in the encrypted form .
    Will it be a good option...or what elsee can I do?

  5. #5
    farrukh is offline Member
    Join Date
    Aug 2012
    Posts
    13
    Rep Power
    0

    Default Re: Share http session between desktop login and web browser login to web application

    I am no WebScarab expert but i think its installation is more like just extracting files in a folder. The server is run by an executable jar file and you should be able to call its main class from your java code to run the server and also to intercept/modify request or response.
    You can use the JSESSIONID and send it over SSL connection. However, The real question is how you are planning to get JSESSIONID from your application and append it to the URL. I don't know your exact requirements or use cases but you can consider making a clickable URL available from your desktop based client application, you can create/update browser cookies or you can update browser's favorite link if your user goes to the site using bookmarked URL.

  6. #6
    sakshi.13agg is offline Member
    Join Date
    Sep 2011
    Posts
    14
    Rep Power
    0

    Default Re: Share http session between desktop login and web browser login to web application

    May I know how can I update browser cookies?

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,586
    Rep Power
    23

    Default Re: Share http session between desktop login and web browser login to web application

    Insert a SetCookie line in the HTTP response header that the browser reads from the server.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Share session between http and https
    By gnorro in forum Advanced Java
    Replies: 1
    Last Post: 02-09-2011, 08:02 AM
  2. Replies: 1
    Last Post: 01-20-2011, 07:01 PM
  3. http post login
    By Billoto in forum Networking
    Replies: 0
    Last Post: 10-03-2010, 04:06 PM
  4. Replies: 2
    Last Post: 12-23-2008, 06:35 PM
  5. Replies: 0
    Last Post: 06-25-2008, 12:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •