class CustomHookSample extends java.lang.Object implements Authenticator
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
authOption
The value of "option" node from AuthPlugin for this Authenticator
|
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
Constructor and Description |
---|
CustomHookSample()
Package private constructor.
|
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()
Always returns
null . |
AuthenticationResponse |
serverAuthHook(byte[] auth,
java.lang.String entity)
Implements server side custom authentication logic.
|
private java.lang.String authOption
public byte[] clientAuthHook(java.util.Map<java.lang.String,java.lang.Object> parameters, int code)
stdin
and stdout
to interact with the user.clientAuthHook
in interface Authenticator
parameters
- Additional configuration parameters.code
- The result of the most recent attempt to authenticate or
AUTH_RESULT_NONE
if this is the first attempt.public AuthenticationResponse serverAuthHook(byte[] auth, java.lang.String entity)
Accepts the byte array produced by the client side authentication hook as authentication input as well as any custom parameters.
serverAuthHook
in interface Authenticator
auth
- The authorization input from the client.entity
- The entity to be authenticated (additionall configuration parameters taken
from the directory).public void clientFinalize()
clientFinalize
in interface Authenticator
public SessionListener getSessionListener()
null
.getSessionListener
in interface Authenticator
null
.public java.util.Set<java.lang.String> getAuthenticationEntities()
getAuthenticationEntities
in interface Authenticator
public void configure(java.lang.String option)
configure
in interface Authenticator
option
- The value of "option" entry for the auth plugin.