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.
    • Field Detail

      • LOGIN_CONTEXT_NAME_KEY

        public static final java.lang.String LOGIN_CONTEXT_NAME_KEY
        See Also:
        Constant Field Values
      • ENABLE_CLIENT_SASL_KEY

        public static final java.lang.String ENABLE_CLIENT_SASL_KEY
        See Also:
        Constant Field Values
      • ENABLE_CLIENT_SASL_DEFAULT

        public static final java.lang.String ENABLE_CLIENT_SASL_DEFAULT
        See Also:
        Constant Field Values
    • Constructor Detail

      • ZooKeeperSaslClient

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

      • isEnabled

        public static boolean isEnabled()
        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:
        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()