Package com.couchbase.client.java.auth
Class PasswordAuthenticator
- java.lang.Object
-
- com.couchbase.client.java.auth.PasswordAuthenticator
-
- All Implemented Interfaces:
Authenticator
@Uncommitted @Public public class PasswordAuthenticator extends Object implements Authenticator
Authenticator
for RBAC users in Couchbase- Since:
- 2.4.4
- Author:
- Subhashni Balakrishnan
-
-
Constructor Summary
Constructors Constructor Description PasswordAuthenticator(String password)
PasswordAuthenticator(String username, String password)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Credential>
getCredentials(CredentialContext context, String specific)
Retrieve the credentials store by thisAuthenticator
for the givenCredentialContext
and optional specific.boolean
isEmpty()
String
password()
String
username()
-
-
-
Method Detail
-
getCredentials
public List<Credential> getCredentials(CredentialContext context, String specific)
Description copied from interface:Authenticator
Retrieve the credentials store by thisAuthenticator
for the givenCredentialContext
and optional specific. If no corresponding credential can be found, an empty list is returned. If the context / specific cannot be processed by this Authenticator, throws anIllegalArgumentException
.- Specified by:
getCredentials
in interfaceAuthenticator
- Parameters:
context
- the context for which the credential(s) will be used.specific
- a more restrictive sub-context specific to the context.- Returns:
- a list of credentials that can be used for the context/operation, or empty list if none was set for this context+specific combination.
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceAuthenticator
- Returns:
- true if this
Authenticator
doesn't have any credentials set.
-
username
public String username()
-
password
public String password()
-
-