File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Sending credentials/data from Swing application to Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Sending credentials/data from Swing application to Servlets" Watch "Sending credentials/data from Swing application to Servlets" New topic
Author

Sending credentials/data from Swing application to Servlets

B Bhutta
Greenhorn

Joined: Jun 28, 2002
Posts: 14
Hi,
I am trying to send some data, such as userid and password, from swing application to the servlet so that I can open an application without loggin in again.
I am thinking to call a URL and add my userid and password in the URL ( http://www.my.com/test?userid=aaa&password=bbb ) and servlet received this information and open up the application without asking to login again to the user. The servlet/site which I am trying to access is a secure site.
I will appreciate your help in this regard.
Thanks.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

Uh uh. If you've logged in and the client's using cookies to track sessions, your work has already been done for you. Just use the HttpURLConnection to make the applet talk to the server. It will propagate everything that's necessary - cookie and all.
For people with cookies disabled, the URL rewriting thingy applies, just as it does for web pages.
Also, if you're a secure site, don't forget to use https in the HttpURLConnection!


Customer surveys are for companies who didn't pay proper attention to begin with.
B Bhutta
Greenhorn

Joined: Jun 28, 2002
Posts: 14
Hi Tim,
Thanks for your input but I am trying to call this url from the swing application.
Are you giving me an idea that I can set a cookie in application or what??
However thanks for the help.
Juanjo Bazan
Ranch Hand

Joined: Feb 04, 2002
Posts: 231
Instead of sending userid & pass, you could send just one parameter with a (MD5?) hash of a userid+pass string.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sending credentials/data from Swing application to Servlets