Class ZooKeeperSaslClient


  • public class ZooKeeperSaslClient
    extends java.lang.Object
    This class manages SASL authentication for the client. It allows ClientCnxn to authenticate using SASL with a ZooKeeper server.
    • Constructor Detail

      • ZooKeeperSaslClient

        public ZooKeeperSaslClient​(java.lang.String serverPrincipal,
                                   ZKClientConfig clientConfig)
                            throws javax.security.auth.login.LoginException
        Throws:
        javax.security.auth.login.LoginException
    • Method Detail

      • isEnabled

        @Deprecated
        public static boolean isEnabled()
        Deprecated.
        Returns true if the SASL client is enabled. By default, the client is enabled but can be disabled by setting the system property zookeeper.sasl.client to false. See ZOOKEEPER-1657 for more information.
        Returns:
        true if the SASL client is enabled.
      • getLoginContext

        public java.lang.String getLoginContext()
      • getConfigStatus

        public java.lang.String getConfigStatus()
        Returns:
        informational message indicating the current configuration status.
      • isComplete

        public boolean isComplete()
      • isFailed

        public boolean isFailed()
      • respondToServer

        public void respondToServer​(byte[] serverToken,
                                    ClientCnxn cnxn)
      • initialize

        public void initialize​(ClientCnxn cnxn)
                        throws javax.security.sasl.SaslException
        Throws:
        javax.security.sasl.SaslException
      • clientTunneledAuthenticationInProgress

        public boolean clientTunneledAuthenticationInProgress()
      • shutdown

        public void shutdown()
        close login thread if running