public interface Authenticator extends SecurityConstants
Securitymanager
will send the implementing class to client for executing and
will also instantiate an object on server-side. If not configured with, the
Securitymanager
will use its own Authenticator
interface to handle
server-side authentication processing of response from client-side.
The Securitymanager
will create iterate all the entities that the server side of
the hook reports with getAuthenticationEntities
and call clientAuthHook
for obtaining credentials for each entity. Then the credentials packaged as a byte array
are decoded and checked by serverAuthHook
on server-side.
AUTH_ACTION_ABORT, AUTH_ACTION_CONTINUE, AUTH_ACTION_DONE, AUTH_ACTION_RETRY, AUTH_MODE_CUSTOM, AUTH_MODE_HIGHEST, AUTH_MODE_IDPW, AUTH_MODE_LOWEST, AUTH_MODE_NONE, AUTH_MODE_X509, AUTH_MODE_X509_IDPW, AUTH_REQ_PROCESS, AUTH_REQ_PROGRAM, AUTH_REQ_USER, AUTH_RESULT_INSUFFICIENT_RIGHTS, AUTH_RESULT_INVALID_PASSWORD, AUTH_RESULT_INVALID_USERID, AUTH_RESULT_NONE, AUTH_RESULT_SKIP_TO_NEXT, AUTH_RESULT_SUCCESS, AUTH_RESULT_UNSPECIFIED_FAILURE, PKT_SIZE_SKIP_TO_NEXT
Modifier and Type | Method and Description |
---|---|
byte[] |
clientAuthHook(java.util.Map<java.lang.String,java.lang.Object> parameters,
int code)
Implements client side custom authentication logic.
|
void |
clientFinalize()
Finalizes any resources allocated during authentication by the client.
|
void |
configure(java.lang.String option)
Configures the Authenticator by setting the "option" parameter from directory.xml.
|
java.util.Set<java.lang.String> |
getAuthenticationEntities()
Returns a set of entities that this class handles.
|
SessionListener |
getSessionListener()
Optionally the server-side may return a session listener.
|
AuthenticationResponse |
serverAuthHook(byte[] auth,
java.lang.String entity)
Implements server side custom authentication logic.
|
byte[] clientAuthHook(java.util.Map<java.lang.String,java.lang.Object> parameters, int code)
parameters
- Additional configuration parameters.code
- The result of the most recent attempt to authenticate or
AUTH_RESULT_NONE
if this is the first attempt.void clientFinalize()
AuthenticationResponse serverAuthHook(byte[] auth, java.lang.String entity)
Accepts the byte array produced by the client side authentication hook as authentication input and custom parameters.
auth
- The authorization input from the client.entity
- The entity to be authenticated.SessionListener getSessionListener()
Session
events (initialization / termination).
The initialization callback will be executed on the client thread, after the correct
context will be created.
The termination callback will be executed when the session ends (the client disconnects).void configure(java.lang.String option)
option
- The value of "option" entry for the auth plugin.java.util.Set<java.lang.String> getAuthenticationEntities()
null
if enumeration of entities could not be executed because of
insufficient information or other non-fatal errors.