# PasswordAuthentication

public final class **PasswordAuthentication** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
The class PasswordAuthentication is a data holder that is used by
Authenticator. It is simply a repository for a user name and a password.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/java/net/Authenticator.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/java/net/Authenticator.html#getPasswordAuthentication()`

### Public Constructor Summary

|---|---|
|   | [PasswordAuthentication](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/PasswordAuthentication.html#PasswordAuthentication(java.lang.String,%20char[]))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) userName, char\[\] password) Creates a new `PasswordAuthentication` object from the given user name and password. |

### Public Method Summary

|---|---|
| char\[\] | [getPassword](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/PasswordAuthentication.html#getPassword())() Returns the user password. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getUserName](https://developers.google.com/j2objc/javadoc/jre/reference/java/net/PasswordAuthentication.html#getUserName())() Returns the user name. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Constructors

#### public
**PasswordAuthentication**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) userName, char\[\] password)

Creates a new `PasswordAuthentication` object from the given
user name and password.

Note that the given user password is cloned before it is stored in
the new `PasswordAuthentication` object.

##### Parameters

| userName | the user name |
| password | the user's password |
|---|---|

## Public Methods

#### public char\[\]
**getPassword**
()

Returns the user password.

Note that this method returns a reference to the password. It is
the caller's responsibility to zero out the password information after
it is no longer needed.

##### Returns

- the password

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**getUserName**
()

Returns the user name.

##### Returns

- the user name