Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

How to passed a login page with java code

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I need to download a file from https URL.
The issue is that if I insert the URL to the iexplorer I redirect to the login page.

This url is accessible only after passing the login.

I want to be able to download this file with java code, but in order to do this I need to passed the login page. As I understand I need to have some kind of session here.
I need to do a login and than based on the response try to navigate to the desire URL.

Can any one give me an example or reference to article about it?

Thank you

Ps. I try Google, but I think I didn�t insert the right keywords.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So... you're trying to protect a resource from being downloaded until after the user has logged in?
Is this right?
 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No,

I am the client for this.

I need to write a client in Java that will download the file from this url, but the url is protect by user and password and you are redirect to the login page.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, I see.

Do you actually have a valid username and password?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In any case, since you're writing client code, not servlets, this is not the correct forum for this question.
I'm moving it to our Sockets and Internet Protocols forum.
 
I am mighty! And this is a mighty small ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!