# Class AuthenticationHelper

java.lang.Object
org.apache.zookeeper.server.AuthenticationHelper

public class AuthenticationHelper extends Object
Contains helper methods to enforce authentication

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`ENFORCE_AUTH_ENABLED`
`static final String`
`ENFORCE_AUTH_SCHEMES`
`static final String`
`SASL_AUTH_SCHEME`
`static final String`
`SESSION_REQUIRE_CLIENT_SASL_AUTH`

## Constructor Summary

Constructors
Constructor
Description
`AuthenticationHelper()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`enforceAuthentication(ServerCnxn connection, int xid)`
Returns true when authentication enforcement was success otherwise returns false also closes the connection
`boolean`
`isEnforceAuthEnabled()`
`boolean`
`isSaslAuthRequired()`

### Methods inherited from class Object

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

## Field Details

### ENFORCE_AUTH_ENABLED

public static final String ENFORCE_AUTH_ENABLED

See Also:
  - Constant Field Values

### ENFORCE_AUTH_SCHEMES

public static final String ENFORCE_AUTH_SCHEMES

See Also:
  - Constant Field Values

### SESSION_REQUIRE_CLIENT_SASL_AUTH

public static final String SESSION_REQUIRE_CLIENT_SASL_AUTH

See Also:
  - Constant Field Values

### SASL_AUTH_SCHEME

public static final String SASL_AUTH_SCHEME

See Also:
  - Constant Field Values

## Constructor Details

### AuthenticationHelper

public AuthenticationHelper()

## Method Details

### isEnforceAuthEnabled

public boolean isEnforceAuthEnabled()

### enforceAuthentication

public boolean enforceAuthentication(ServerCnxn connection, int xid) throws IOException
Returns true when authentication enforcement was success otherwise returns false also closes the connection

Parameters:
  `connection` - server connection
  `xid` - current operation xid
Returns:
  true when authentication enforcement is success otherwise false
Throws:
  `IOException`

### isSaslAuthRequired

public boolean isSaslAuthRequired()