• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Urgent help Required!!

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! ALL,
I've created a program to download files from internet. In this program I've used.........
java.net.Authenticator and java.net.PasswordAuthentication
package to authenticate the website. This was working fine when the site had small pop up window for Login but this logic is not working for the site which requires User to enter User Id and pass on the site itself and not in Pop up window. So tell me what to do in this situation.

SS
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java.net.Authenticator and java.net.PasswordAuthentication do not deal with HTML-FORM base anthentication, and there is no standard way how do peoples define their HTML username and password fields. If you are making a generic utility to do this job, it would be a pretty hard task. in your java code, you have to parse HTML page which has username and password field on it, to get input field name of these two field and Action URL then using HTTP POST in your URLConnection code to open connection.
for specific web site, you do not need to parse HTML page. you can find these information advance.
third way, You can develop a simple WEB browser to do this trick.
 
Sanjeev Shahi
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! Sunny,
Thanks for your reply. Yes after going through the details of java.net.Authenticator I came to know that it is not for HTML form.
I am creating application for specific URL. Could you please give me some help how to do it. It's really urgent. I want application to take username and pass automatically.
Thanks a lot ,
SS
 
Sanjeev Shahi
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! Sunny,
Just wanted to tell you I got the solution by using setRequestProperty()

SS
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic