The class Authenticator represents an object that knows how to obtain authentication for a network connection. Usually, it will do this by prompting the user for information.
Applications use this class by overriding {@link #getPasswordAuthentication()} in a sub-class. This method willtypically use the various getXXX() accessor methods to get information about the entity requesting authentication. It must then acquire a username and password either by interacting with the user or through some other non-interactive means. The credentials are then returned as a {@link PasswordAuthentication} return value.
An instance of this concrete sub-class is then registered with the system by calling {@link #setDefault(Authenticator)}. When authentication is required, the system will invoke one of the requestPasswordAuthentication() methods which in turn will call the getPasswordAuthentication() method of the registered object.
All methods that request authentication have a default implementation that fails.
@see java.net.Authenticator#setDefault(java.net.Authenticator)
@see java.net.Authenticator#getPasswordAuthentication()
@author Bill Foote
@version 1.33, 11/17/05
@since 1.2