Added in API level 1

PasswordAuthentication

class PasswordAuthentication
kotlin.Any
   ↳ java.net.PasswordAuthentication

The class PasswordAuthentication is a data holder that is used by Authenticator. It is simply a repository for a user name and a password.

Summary

Public constructors
PasswordAuthentication(userName: String!, password: CharArray!)

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

Public methods
CharArray!

Returns the user password.

String!

Returns the user name.

Public constructors

PasswordAuthentication

Added in API level 1
PasswordAuthentication(
    userName: String!,
    password: CharArray!)

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 String!: the user name
password CharArray!: the user's password

Public methods

getPassword

Added in API level 1
fun getPassword(): CharArray!

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.

Return
CharArray! the password

getUserName

Added in API level 1
fun getUserName(): String!

Returns the user name.

Return
String! the user name