Package com.couchbase.client.core.env
Class PasswordAuthenticator
java.lang.Object
com.couchbase.client.core.env.PasswordAuthenticator
- All Implemented Interfaces:
Authenticator
Performs authentication against a couchbase server cluster using username and password.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classProvides customization to thePasswordAuthenticator. -
Method Summary
Modifier and TypeMethodDescriptionvoidauthHttpRequest(ServiceType serviceType, com.couchbase.client.core.deps.io.netty.handler.codec.http.HttpRequest request) Allows to add authentication credentials to the http request for the given service.voidauthKeyValueConnection(EndpointContext ctx, com.couchbase.client.core.deps.io.netty.channel.ChannelPipeline pipeline) Allows the authenticator to add KV handlers during connection bootstrap to perform authentication.builder()Creates a newPasswordAuthenticator.Builderwhich allows to customize this authenticator.static PasswordAuthenticatorCreates a new password authenticator with the default settings.static PasswordAuthenticatorldapCompatible(String username, String password) Creates a LDAP compatible password authenticator which is INSECURE if not used with TLS.com.couchbase.client.core.deps.io.grpc.CallCredentialsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.couchbase.client.core.env.Authenticator
applyTlsProperties, supportsNonTls, supportsTls
-
Method Details
-
builder
Creates a newPasswordAuthenticator.Builderwhich allows to customize this authenticator. -
create
Creates a new password authenticator with the default settings.- Parameters:
username- the username to use for all authentication.password- the password to use alongside the username.- Returns:
- the instantiated
PasswordAuthenticator.
-
ldapCompatible
Creates a LDAP compatible password authenticator which is INSECURE if not used with TLS.Please note that this is INSECURE and will leak user credentials on the wire to eavesdroppers. This should only be enabled in trusted environments.
- Parameters:
username- the username to use for all authentication.password- the password to use alongside the username.- Returns:
- the instantiated
PasswordAuthenticator.
-
authKeyValueConnection
public void authKeyValueConnection(EndpointContext ctx, com.couchbase.client.core.deps.io.netty.channel.ChannelPipeline pipeline) Description copied from interface:AuthenticatorAllows the authenticator to add KV handlers during connection bootstrap to perform authentication.- Specified by:
authKeyValueConnectionin interfaceAuthenticator- Parameters:
ctx- the endpoint context.pipeline- the pipeline when the endpoint is constructed.
-
authHttpRequest
public void authHttpRequest(ServiceType serviceType, com.couchbase.client.core.deps.io.netty.handler.codec.http.HttpRequest request) Description copied from interface:AuthenticatorAllows to add authentication credentials to the http request for the given service.- Specified by:
authHttpRequestin interfaceAuthenticator- Parameters:
serviceType- the service for this request.request- the http request.
-
protostellarCallCredentials
public com.couchbase.client.core.deps.io.grpc.CallCredentials protostellarCallCredentials()- Specified by:
protostellarCallCredentialsin interfaceAuthenticator
-