dcsimg
Authentication of URLs from within a Java Applet
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Kyle_Morris
Posted On:   Friday, January 25, 2002 12:09 AM

In my applet I am using the following code to Authenticate access to all URLs accessed with the Applet. try { sourceURL = new URL(URLString); } catch (java.net.MalformedURLException me) { } String encoding = new sun.misc.BASE64Encoder().encode(authentication.getBytes()); try { sourceConnection = sourceURL.openConnection(); } catch (java.io.IOException ie) { } sourceConnection.setRequestProperty ("Authorization", "Basic " + encoding); In my particular case I am retrieving XML from ASP pages. The problem I am hav   More>>

In my applet I am using the following code to Authenticate access to all URLs accessed with the Applet.

			

try {

sourceURL = new URL(URLString);

}

catch (java.net.MalformedURLException me) { }

String encoding = new sun.misc.BASE64Encoder().encode(authentication.getBytes());

try {

sourceConnection = sourceURL.openConnection();

}

catch (java.io.IOException ie) { }

sourceConnection.setRequestProperty ("Authorization", "Basic " + encoding);



In my particular case I am retrieving XML from ASP pages. The problem I am having is that sometimes this method of authentication is being ignored, and the Applet doesn't seem to then prompt the user for authentication.

Basically I'm just wondering whether anyone has seen this phenomena before, and if so, how did they fix it?

Cheers!

Kyle

   <<Less
About | Sitemap | Contact