Skip to content

Most visited

Recently visited

navigation
Added in API level 1

PasswordAuthentication

public final class PasswordAuthentication
extends Object

java.lang.Object
   ↳ java.net.PasswordAuthentication


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.

Inherited methods

From class java.lang.Object

Public constructors

PasswordAuthentication

Added in API level 1
PasswordAuthentication (String userName, 
                char[] password)

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

getPassword

Added in API level 1
char[] getPassword ()

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.

getUserName

Added in API level 1
String getUserName ()

Gets the username stored by this instance.

Returns
String the stored username.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.