ZooKeeperSaslClient (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

org.apache.zookeeper.client

## Class ZooKeeperSaslClient

- java.lang.Object
- - org.apache.zookeeper.client.ZooKeeperSaslClient

-     public class ZooKeeperSaslClient
      extends Object

  This class manages SASL authentication for the client. It allows ClientCnxn to authenticate using SASL with a ZooKeeper server.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ZooKeeperSaslClient.SaslState`
    `static class` | `ZooKeeperSaslClient.ServerSaslResponseCallback`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ENABLE_CLIENT_SASL_DEFAULT` Deprecated. Use `ZKClientConfig.ENABLE_CLIENT_SASL_DEFAULT` instead.
    `static String` | `ENABLE_CLIENT_SASL_KEY` Deprecated. Use `ZKClientConfig.ENABLE_CLIENT_SASL_KEY` instead.
    `static String` | `LOGIN_CONTEXT_NAME_KEY` Deprecated. Use `ZKClientConfig.LOGIN_CONTEXT_NAME_KEY` instead.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ZooKeeperSaslClient(String serverPrincipal, ZKClientConfig clientConfig)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `clientTunneledAuthenticationInProgress()`
    `String` | `getConfigStatus()`
    `Watcher.Event.KeeperState` | `getKeeperState()`
    `String` | `getLoginContext()`
    `ZooKeeperSaslClient.SaslState` | `getSaslState()`
    `void` | `initialize(ClientCnxn cnxn)`
    `boolean` | `isComplete()`
    `static boolean` | `isEnabled()` Deprecated. Use `ZKClientConfig.isSaslClientEnabled()` instead
    `boolean` | `isFailed()`
    `void` | `respondToServer(byte[] serverToken, ClientCnxn cnxn)`
    `void` | `shutdown()` close login thread if running

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LOGIN_CONTEXT_NAME_KEY

          @Deprecated
          public static final String LOGIN_CONTEXT_NAME_KEY

      Deprecated. Use `ZKClientConfig.LOGIN_CONTEXT_NAME_KEY` instead.
      See Also:
        Constant Field Values

    - #### ENABLE_CLIENT_SASL_KEY

          @Deprecated
          public static final String ENABLE_CLIENT_SASL_KEY

      Deprecated. Use `ZKClientConfig.ENABLE_CLIENT_SASL_KEY` instead.
      See Also:
        Constant Field Values

    - #### ENABLE_CLIENT_SASL_DEFAULT

          @Deprecated
          public static final String ENABLE_CLIENT_SASL_DEFAULT

      Deprecated. Use `ZKClientConfig.ENABLE_CLIENT_SASL_DEFAULT` instead.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ZooKeeperSaslClient

          public ZooKeeperSaslClient(String serverPrincipal,
                                     ZKClientConfig clientConfig)
                              throws LoginException

      Throws:
        `LoginException`

  - ### Method Detail

    - #### isEnabled

          @Deprecated
          public static boolean isEnabled()

      Deprecated. Use `ZKClientConfig.isSaslClientEnabled()` instead
      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.

    - #### getSaslState

          public ZooKeeperSaslClient.SaslState getSaslState()

    - #### getLoginContext

          public String getLoginContext()

    - #### getConfigStatus

          public 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)

    - #### getKeeperState

          public Watcher.Event.KeeperState getKeeperState()

    - #### initialize

          public void initialize(ClientCnxn cnxn)
                          throws SaslException

      Throws:
        `SaslException`

    - #### clientTunneledAuthenticationInProgress

          public boolean clientTunneledAuthenticationInProgress()

    - #### shutdown

          public void shutdown()

      close login thread if running

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.