|
-
Feb 26th, 2004, 01:38 PM
#1
Thread Starter
Dazed Member
HTTP Authentication
Does anyone know how i can implement HTTP Authentication on a site? java.net.url has a method named setDefault(Authenticator a) so i assume that i have to create a custom subclass extending java.net.Authenticator. From what i have read i have to provide implementation for the requestPasswordAuthentication(InetAddress address, int port, String protocol, String prompt, String scheme) method. The docs say that when the url class needs a user name and password, it will ask the class that was passed in to setDefault() for it using the above method. The docs go on to say that the another method that must be overridden is PasswordAuthentication getPasswordAuthentication(). Then we have the PasswordAuthentication class which has it's constructor as PasswordAuthentication(String username, char[] password).
So how do i piece all of this togther?
Last edited by Dilenger4; Feb 26th, 2004 at 11:26 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|