aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes HTTP authentication - can't figure it out! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "HTTP authentication - can Watch "HTTP authentication - can New topic
Author

HTTP authentication - can't figure it out!

joey jojo
Greenhorn

Joined: Nov 17, 2011
Posts: 1
I'm trying to download a file from a website, however, you need to login prior to accessing the file. If I try and access the file using the direct url path, it just redirects me to the login page. The server uses basic authentication.

Here's an example I found on the internet. However, I can't get it to work; it still redirects me to the login page. Am I missing something?

Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Is the getPasswordAuthentication method ever being called?

For any HTTP operation more complex than a simple URL access (like if authentication is involved) I'd use the Apache HttpClient library.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

And welcome to the Ranch!


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP authentication - can't figure it out!