code: public static PasswordAuthentication requestPasswordAuthentication(
                                              InetAddress addr,
                                              int port,
                                              String protocol,
                                              String prompt,
                                              String scheme) {
  
          SecurityManager sm = System.getSecurityManager();
          if (sm != null) {
              NetPermission requestPermission
                  = new NetPermission("requestPasswordAuthentication");
              sm.checkPermission(requestPermission);
          }
  
          Authenticator a = theAuthenticator;
          if (a == null) {
              return null;
          } else {
              synchronized(a) {
                  a.reset();
                  a.requestingSite = addr;
                  a.requestingPort = port;
                  a.requestingProtocol = protocol;
                  a.requestingPrompt = prompt;
                  a.requestingScheme = scheme;
                  return a.getPasswordAuthentication();
              }
          }
      }
docs: Ask the authenticator that has been registered with the system
  for a password.
  <p>
  First, if there is a security manager, its {@code checkPermission}
  method is called with a
  {@code NetPermission("requestPasswordAuthentication")} permission.
  This may result in a java.lang.SecurityException.
  
  @param addr The InetAddress of the site requesting authorization,
  or null if not known.
  @param port the port for the requested connection
  @param protocol The protocol that's requesting the connection
  ({@link java.net.Authenticator#getRequestingProtocol()})
  @param prompt A prompt string for the user
  @param scheme The authentication scheme
  
  @return The username/password, or null if one can't be gotten.
  
  @throws SecurityException
  if a security manager exists and its
  {@code checkPermission} method doesn't allow
  the password authentication request.
  
  @see SecurityManager#checkPermission
  @see java.net.NetPermission