11

I want to transfer web login session to my java desktop application ,so that once again I don't want to login in my desktop application.

Once the user logs into my web application, I set some cookies on the user system, once he starts my standalone application I would like to use the credentials stored here to log my user into the application without asking to re-login.

My questions: - Can I access the cookies to read Auth token and other params? Is this the proper solution? - To achieve the above requirement , is there any proper solution.

Cookie seemed like a solution for me here. But in essence I want a seamless integration between the web application and the standalone application. What kind of solutions are available for this?

Handroid
  • 399
  • 1
  • 2
  • 13
  • Sharing cookies between browser is not possible. I would think that is the case for applications too. http://superuser.com/questions/271710/synchronize-cookies-between-browsers.. Not sure if you can read cookie if you embed the browser into your app. – Jayan Dec 25 '15 at 04:57

3 Answers3

3

For the above requirement we need to use Java Web Start technology Here is the link http://docs.oracle.com/javase/tutorial/deployment/webstart/

Handroid
  • 399
  • 1
  • 2
  • 13
1

Not sure how Skype does it, but it looks like both WebEx and GotoMeeting rely on custom browser extensions that require a permission to "Communicate with cooperating native applications" (example setting from Chrome).

I couldn't find anything that's native to JNLP that allows you to read browser cookies since it's supposed to be sandboxed. However, after logging via the Java app, you should be able to use the JNLP Persistence APIs, if that helps.

Cahit
  • 2,484
  • 19
  • 23
1

I think you should do reversely, when you login on web, transfer some Session ID to desktop application.

My idea is running a localhost server in your desktop app on some port (use Jetty). When you login on web, it will call a url to that local server to transfer session ID. Ex:

localhost:8888/authen?sessionID=123456

Then the local server will get that sessionID param.

If you feel this is suitable for you, I will explain more detail

yelliver
  • 5,648
  • 5
  • 34
  • 65