Android APIs
public final class

PasswordAuthentication

extends Object
java.lang.Object
   ↳ java.net.PasswordAuthentication

Class Overview

This immutable class is a data structure that encapsulates username and password which is used by the Authenticator class.

See also:

Summary

Public Constructors
PasswordAuthentication(String userName, char[] password)
Creates an instance of a password authentication with a specified username and password.
Public Methods
char[] getPassword()
Gets a clone of the password stored by this instance.
String getUserName()
Gets the username stored by this instance.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PasswordAuthentication (String userName, char[] password)

Added in API level 1

Creates an instance of a password authentication with a specified username and password.

Parameters
userName String: the username to store.
password char: the associated password to store.

Public Methods

public char[] getPassword ()

Added in API level 1

Gets a clone of the password stored by this instance. The user is responsible to finalize the returned array if the password clone is no longer needed.

Returns
char[] the copied password.

public String getUserName ()

Added in API level 1

Gets the username stored by this instance.

Returns
String the stored username.