Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Sending credentials/data from Swing application to Servlets

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Saloon Keeper
Posts: 22498
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
B Bhutta
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of sending userid & pass, you could send just one parameter with a (MD5?) hash of a userid+pass string.
 
Message for you sir! I think it is a tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic