Package org.apache.zookeeper.client
Class ZooKeeperSaslClient
java.lang.Object
org.apache.zookeeper.client.ZooKeeperSaslClient
This class manages SASL authentication for the client. It
allows ClientCnxn to authenticate using SASL with a ZooKeeper server.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Deprecated.static final String
Deprecated.UseZKClientConfig.ENABLE_CLIENT_SASL_KEY
instead.static final String
Deprecated.UseZKClientConfig.LOGIN_CONTEXT_NAME_KEY
instead. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
initialize
(ClientCnxn cnxn) boolean
static boolean
Deprecated.UseZKClientConfig.isSaslClientEnabled()
insteadboolean
isFailed()
void
respondToServer
(byte[] serverToken, ClientCnxn cnxn) void
shutdown()
close login thread if running
-
Field Details
-
LOGIN_CONTEXT_NAME_KEY
Deprecated.UseZKClientConfig.LOGIN_CONTEXT_NAME_KEY
instead.- See Also:
-
ENABLE_CLIENT_SASL_KEY
Deprecated.UseZKClientConfig.ENABLE_CLIENT_SASL_KEY
instead.- See Also:
-
ENABLE_CLIENT_SASL_DEFAULT
Deprecated.UseZKClientConfig.ENABLE_CLIENT_SASL_DEFAULT
instead.- See Also:
-
-
Constructor Details
-
ZooKeeperSaslClient
public ZooKeeperSaslClient(String serverPrincipal, ZKClientConfig clientConfig) throws LoginException - Throws:
LoginException
-
-
Method Details
-
isEnabled
Deprecated.UseZKClientConfig.isSaslClientEnabled()
insteadReturns true if the SASL client is enabled. By default, the client is enabled but can be disabled by setting the system propertyzookeeper.sasl.client
tofalse
. See ZOOKEEPER-1657 for more information.- Returns:
- true if the SASL client is enabled.
-
getSaslState
-
getLoginContext
-
getConfigStatus
- Returns:
- informational message indicating the current configuration status.
-
isComplete
public boolean isComplete() -
isFailed
public boolean isFailed() -
respondToServer
-
getKeeperState
-
initialize
- Throws:
SaslException
-
clientTunneledAuthenticationInProgress
public boolean clientTunneledAuthenticationInProgress() -
shutdown
public void shutdown()close login thread if running
-
ZKClientConfig.ENABLE_CLIENT_SASL_DEFAULT
instead.