public static class PasswordAuthenticator.Builder extends Object
PasswordAuthenticator.| Constructor and Description |
|---|
Builder()
Deprecated.
Please use Builder(String, String) or {@link Builder(Supplier)} instead.
|
| Modifier and Type | Method and Description |
|---|---|
PasswordAuthenticator.Builder |
allowedSaslMechanisms(Set<SaslMechanism> allowedSaslMechanisms)
Allows to set a list of allowed SASL mechanisms for the NON-TLS connections.
|
PasswordAuthenticator |
build()
Creates the
PasswordAuthenticator based on the customization in this builder. |
PasswordAuthenticator.Builder |
enablePlainSaslMechanism()
This method acts as a shortcut to
allowedSaslMechanisms(Set) which adds SaslMechanism.PLAIN
to the allowed mechanism list for NON TLS connections. |
PasswordAuthenticator.Builder |
onlyEnablePlainSaslMechanism()
This method will ONLY enable the PLAIN SASL mechanism (useful for LDAP enabled environments).
|
PasswordAuthenticator.Builder |
password(String password)
Deprecated.
Please specify the password when creating the builder,
using one of the "See Also" methods.
|
PasswordAuthenticator.Builder |
password(Supplier<String> password)
Deprecated.
This method does not support returning username and password as an atomic unit.
Please use
PasswordAuthenticator.builder(Supplier) instead. |
PasswordAuthenticator.Builder |
username(String username)
Deprecated.
Please specify the username when creating the builder,
using one of the "See Also" methods.
|
PasswordAuthenticator.Builder |
username(Supplier<String> username)
Deprecated.
This method does not support returning username and password as an atomic unit.
Please use
PasswordAuthenticator.builder(Supplier) instead. |
@Deprecated public Builder()
@Deprecated public PasswordAuthenticator.Builder username(String username)
username - the username to use.PasswordAuthenticator.builder(String, String),
PasswordAuthenticator.builder(Supplier)@Deprecated public PasswordAuthenticator.Builder username(Supplier<String> username)
PasswordAuthenticator.builder(Supplier) instead.
IMPORTANT: The supplier's get() method must not do blocking IO.
See PasswordAuthenticator.builder(Supplier) for details about why this is
important, and what to do instead of blocking IO.
username - A supplier that returns the username to use.@Deprecated public PasswordAuthenticator.Builder password(String password)
password - the password to alongside for the username provided.PasswordAuthenticator.builder(String, String),
PasswordAuthenticator.builder(Supplier)@Deprecated public PasswordAuthenticator.Builder password(Supplier<String> password)
PasswordAuthenticator.builder(Supplier) instead.Every time the SDK needs to authenticate against the server, it will re-evaluate the supplier. This means that you can pass in a supplier that dynamically loads a password from a (remote) source without taking the application down on a restart.
It is VERY IMPORTANT that this supplier must not block on IO. It is called in async contexts and blocking for a longer amount of time will stall SDK resources like async event loops.
password - the password to alongside for the username provided.public PasswordAuthenticator.Builder allowedSaslMechanisms(Set<SaslMechanism> allowedSaslMechanisms)
Note that if you add SaslMechanism.PLAIN to the list, this will cause credential leakage on the network
since PLAIN sends the credentials in cleartext. It is disabled by default to prevent downgrade attacks. We
recommend using a TLS connection instead.
allowedSaslMechanisms - the list of allowed sasl mechs for non-tls connections.public PasswordAuthenticator.Builder enablePlainSaslMechanism()
allowedSaslMechanisms(Set) which adds SaslMechanism.PLAIN
to the allowed mechanism list for NON TLS connections.
Please note that this is INSECURE and will leak user credentials on the wire to eavesdroppers. This should only be enabled in trusted environments - we recommend connecting via TLS to the cluster instead.
If you are running an LDAP enabled environment, please use onlyEnablePlainSaslMechanism() instead!
public PasswordAuthenticator.Builder onlyEnablePlainSaslMechanism()
Please note that this is INSECURE and will leak user credentials on the wire to eavesdroppers. This should only be enabled in trusted environments - we recommend connecting via TLS to the cluster instead.
You might also want to consider using the static constructor method PasswordAuthenticator.ldapCompatible(String, String) as a
shortcut.
public PasswordAuthenticator build()
PasswordAuthenticator based on the customization in this builder.Copyright © 2024 Couchbase, Inc.. All rights reserved.