Package com.couchbase.lite
Class BasicAuthenticator
- java.lang.Object
-
- com.couchbase.lite.Authenticator
-
- com.couchbase.lite.BasicAuthenticator
-
public final class BasicAuthenticator extends Authenticator
The BasicAuthenticator class is an authenticator that will authenticate using HTTP Basic auth with the given username and password. This should only be used over an SSL/TLS connection, as otherwise it's very easy for anyone sniffing network traffic to read the password.
-
-
Constructor Summary
Constructors Constructor Description BasicAuthenticator(String username, char[] password)
Create a Basic Authenticator.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getPassword()
Deprecated.UsegetPasswordChars(char[])
char[]
getPasswordChars()
Get the password.String
getUsername()
-
-
-
Constructor Detail
-
BasicAuthenticator
public BasicAuthenticator(@NonNull String username, @NonNull char[] password)
Create a Basic Authenticator. The new instance contains a copy of the password char[] parameter: the owner of the original retains the responsibility for zeroing it before releasing it.
-
-
Method Detail
-
getUsername
@NonNull public String getUsername()
-
getPassword
@Deprecated @NonNull public String getPassword()
Deprecated.UsegetPasswordChars(char[])
-
getPasswordChars
@NonNull public char[] getPasswordChars()
Get the password. The returned char[] is a copy: the owner is responsible for zeroing it before releasing it.- Returns:
- the password, as a char[].
-
-