Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / February 2006

Tip: Looking for answers? Try searching our database.

Automate authentication of a web-site through HTTPUrlConnection

Thread view: 
rajivranjan09@gmail.com - 27 Feb 2006 08:10 GMT
Hi Guys,

I have a website which uses SSL communication. When someone tries to
access this site, it pops up a HTTP authentication box and only on
successfull authentication can a client access the site.

I am trying to write a utility whcih can try to access this site once a
day. I am using HTTPUrlConnection for this but I have no idea how would
the utility  provide credentials information to the application. I
tried doing this -

URL mySite = new URL(mySiteURL);
HttpURLConnection mySiteConn =
(HttpURLConnection)mySite.openConnection();
mySiteConn.setRequestProperty("Authentication", "rajiv:welcome");
mySiteConn.setRequestMethod("GET");
int httpStatusCode = mySiteConn.getResponseCode();

but "mySiteConn.getResponseCode()" is throwing IOException.

Can someone please tell me how can I possibly do this?

_Rajiv
William Brogden - 27 Feb 2006 15:35 GMT
> Hi Guys,
>
[quoted text clipped - 19 lines]
>
> _Rajiv

You might want to look into the HttpClient toolkit

http://jakarta.apache.org/commons/httpclient/sslguide.html

Signature

Using Opera's revolutionary e-mail client: http://www.opera.com/m2/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.