Interface AuthenticatorFactory
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
KerberosFactory
,PlainFactory
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 Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.security.UserGroupInformation
createAndLoginUser
(Map<String, ?> properties) Create and get the login user based on the given properties.createSaslClient
(org.apache.hadoop.security.UserGroupInformation ugi, Map<String, ?> properties) The caller is responsible fordisposing
the returned SaslClient.createSaslServer
(org.apache.hadoop.security.UserGroupInformation ugi, Map<String, ?> properties) The caller is responsible fordisposing
the returned SaslServer.Name of the mechanism, in upper case.Methods inherited from interface java.lang.AutoCloseable
close
-
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 IOExceptionCreate 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 SaslExceptionThe caller is responsible fordisposing
the returned SaslServer.- Parameters:
ugi
- ugiproperties
- config properties- Returns:
- sasl server
- Throws:
SaslException
-
createSaslClient
SaslClient createSaslClient(org.apache.hadoop.security.UserGroupInformation ugi, Map<String, ?> properties) throws SaslExceptionThe caller is responsible fordisposing
the returned SaslClient.- Parameters:
ugi
- ugiproperties
- config properties- Returns:
- sasl client
- Throws:
SaslException
-