public static PasswordAuthentication requestPasswordAuthentication (String host, InetAddress addr, int port, String protocol, String prompt, String scheme)

Ask the authenticator that has been registered with the system for a password. This is the preferred method for requesting a password because the hostname can be provided in cases where the InetAddress is not available.

First, if there is a security manager, its checkPermission method is called with a NetPermission("requestPasswordAuthentication") permission. This may result in a java.lang.SecurityException.

Parameters:
host    The hostname of the site requesting authentication.
addr    The InetAddress of the site requesting authentication, or null if not known.
port    the port for the requested connection.
protocol    The protocol that's requesting the connection (java.net.Authenticator.getRequestingProtocol())
prompt    A prompt string for the user which identifies the authentication realm.
scheme    The authentication scheme

Returns:  The username/password, or null if one can't be gotten.

Exceptions:
SecurityException     if a security manager exists and its checkPermission method doesn't allow the password authentication request.

See also:
SecurityManager.checkPermission, java.net.NetPermission

Since:  1.4