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 enumstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.static final StringDeprecated.UseZKClientConfig.ENABLE_CLIENT_SASL_KEYinstead.static final StringDeprecated.UseZKClientConfig.LOGIN_CONTEXT_NAME_KEYinstead. -
Constructor Summary
ConstructorsConstructorDescriptionZooKeeperSaslClient(String serverPrincipal, ZKClientConfig clientConfig, AtomicReference<Login> loginRef) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidinitialize(ClientCnxn cnxn) booleanstatic booleanDeprecated.UseZKClientConfig.isSaslClientEnabled()insteadbooleanisFailed()voidrespondToServer(byte[] serverToken, ClientCnxn cnxn)
-
Field Details
-
LOGIN_CONTEXT_NAME_KEY
Deprecated.UseZKClientConfig.LOGIN_CONTEXT_NAME_KEYinstead.- See Also:
-
ENABLE_CLIENT_SASL_KEY
Deprecated.UseZKClientConfig.ENABLE_CLIENT_SASL_KEYinstead.- See Also:
-
ENABLE_CLIENT_SASL_DEFAULT
Deprecated.UseZKClientConfig.ENABLE_CLIENT_SASL_DEFAULTinstead.- See Also:
-
-
Constructor Details
-
ZooKeeperSaslClient
public ZooKeeperSaslClient(String serverPrincipal, ZKClientConfig clientConfig, AtomicReference<Login> loginRef) 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.clienttofalse. 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()
-
ZKClientConfig.ENABLE_CLIENT_SASL_DEFAULTinstead.