Class BasicAuthenticator

  • All Implemented Interfaces:

    public final class BasicAuthenticator
    extends com.couchbase.lite.internal.BaseAuthenticator
    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 Detail

      • BasicAuthenticator

        public BasicAuthenticator​(@NonNull
                                  String username,
                                  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

        public String getUsername()
      • getPassword

        public String getPassword()
        Use getPasswordChars(char[])
      • getPasswordChars

        public char[] getPasswordChars()
        Get the password. The returned char[] is a copy: the owner is responsible for zeroing it before releasing it.
        the password, as a char[].
      • authenticate

        protected void authenticate​(@NonNull
                                    Map<String,​Object> options)
        Specified by:
        authenticate in class com.couchbase.lite.internal.BaseAuthenticator