Results 1 to 2 of 2

Thread: HTTP Authentication

Threaded View

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width