Interface AuthenticatorFactory

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
KerberosFactory, PlainFactory

public interface AuthenticatorFactory extends AutoCloseable
An implementation of this factory will be initialized once at startup, if the authenticator is enabled (see getSimpleName()). For every request for this mechanism (i.e. after establishing a connection), createSaslServer(org.apache.hadoop.security.UserGroupInformation, java.util.Map<java.lang.String, ?>) will be invoked on the server-side and createSaslClient(org.apache.hadoop.security.UserGroupInformation, java.util.Map<java.lang.String, ?>) will be invoked on the client-side. Note: + Custom authenticators must have a default constructor. Examples: PlainFactory and KerberosFactory.
  • Method Details

    • getSimpleName

      String getSimpleName()
      Name of the mechanism, in upper case. If this mechanism is present in the list of enabled mechanisms, an instance of this factory is loaded. Note that the simple name maybe the same as it's SASL name.
      Returns:
      mechanism name
    • createAndLoginUser

      org.apache.hadoop.security.UserGroupInformation createAndLoginUser(Map<String,?> properties) throws IOException
      Create and get the login user based on the given properties.
      Parameters:
      properties - config properties
      Returns:
      ugi
      Throws:
      IOException
    • createSaslServer

      SaslServer createSaslServer(org.apache.hadoop.security.UserGroupInformation ugi, Map<String,?> properties) throws SaslException
      The caller is responsible for disposing the returned SaslServer.
      Parameters:
      ugi - ugi
      properties - config properties
      Returns:
      sasl server
      Throws:
      SaslException
    • createSaslClient

      SaslClient createSaslClient(org.apache.hadoop.security.UserGroupInformation ugi, Map<String,?> properties) throws SaslException
      The caller is responsible for disposing the returned SaslClient.
      Parameters:
      ugi - ugi
      properties - config properties
      Returns:
      sasl client
      Throws:
      SaslException