class SecurityManagerAuthenticator extends java.lang.Object implements Authenticator
SecurityManager.serverAuthenticator allows resetting SecurityManager instance.| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
authOption
The value of "option" node from AuthPlugin for this Authenticator
|
private static CentralLogger |
LOG
Logger.
|
private SecurityManager |
sm
SecurityManager instance.
|
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_SSO, AUTH_REQ_USER, AUTH_RESULT_INSUFFICIENT_RIGHTS, AUTH_RESULT_INVALID_PASSWORD, AUTH_RESULT_INVALID_USERID, AUTH_RESULT_NONE, AUTH_RESULT_PER_USER_SESSION_LIMIT_REACHED, AUTH_RESULT_SKIP_TO_NEXT, AUTH_RESULT_SUCCESS, AUTH_RESULT_SYSTEM_SESSION_LIMIT_REACHED, AUTH_RESULT_UNSPECIFIED_FAILURE, PKT_SIZE_SKIP_TO_NEXT| Constructor and Description |
|---|
SecurityManagerAuthenticator(SecurityManager securityManager)
Public constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
agePassword(UserAccount user)
Calculates the age of the existing user account password and checks to
see whether it is too old, according to the maxAge parameter.
|
private boolean |
checkPassword(java.lang.String plain,
UserAccount user)
Verifies the plain text password against the one stored with
the specified user account.
|
byte[] |
clientAuthHook(java.util.Map<java.lang.String,java.lang.Object> parameters,
int code)
Implements client side standard authentication logic.
|
(package private) byte[] |
clientAuthHookWorker(java.util.Map<java.lang.String,java.lang.Object> parameters,
int code,
BootstrapConfig config)
Implements client side standard 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 standard authorization logic.
|
private static final CentralLogger LOG
private SecurityManager sm
private java.lang.String authOption
SecurityManagerAuthenticator(SecurityManager securityManager)
securityManager - SecurityManager instance.public byte[] clientAuthHook(java.util.Map<java.lang.String,java.lang.Object> parameters,
int code)
Returns a byte array to be transmitted to the server as authentication
input. The userid and password values will be obtained by prompting
the user using stdin and stdout.
If this method is called, it simply provides a userID and password no matter what authentication mode is. It works, because certificates are verified before the call, if the authentication mode required that.
This logic allows specifying
com.goldencode.p2j.security.SecurityManager as a hook name.
clientAuthHook in interface Authenticatorparameters - Additional configuration parameters. Not used in this
implementation.code - The result of the most recent attempt to authenticate or
AUTH_RESULT_NONE if this is the first attempt.serverAuthHook(byte[], java.lang.String)
for authentication processing.public void clientFinalize()
clientFinalize in interface Authenticatorpublic AuthenticationResponse serverAuthHook(byte[] auth, java.lang.String entity)
Accepts the byte array produced by the client side authorization hook as the authentication input, and custom parameters.
serverAuthHook in interface Authenticatorauth - The authentication input from the client in a form that is
created using SecurityUtil.packageIdPassword(java.lang.String, java.lang.String).entity - Entity to be processed.
Not used in this implementation.public SessionListener getSessionListener()
null.getSessionListener in interface Authenticatornull.public void configure(java.lang.String option)
configure in interface Authenticatoroption - The value of "option" entry for the auth plugin.public java.util.Set<java.lang.String> getAuthenticationEntities()
getAuthenticationEntities in interface Authenticatornull.byte[] clientAuthHookWorker(java.util.Map<java.lang.String,java.lang.Object> parameters,
int code,
BootstrapConfig config)
Returns a byte array to be transmitted to the server as authentication
input. If not contained in the given bootstrap configuration, the userid
and password values will be obtained by prompting the user using
stdin and stdout.
If this method is called, it simply provides a userID and password no matter what authentication mode is. It works, because certificates are verified before the call, if the authentication mode required that.
parameters - Additional configuration parameters. Not used in this
implementation.code - The result of the most recent attempt to authenticate or
AUTH_RESULT_NONE if this is the first attempt.config - Configuration data upon which to base default processing.serverAuthHook(byte[], java.lang.String)
for authentication processing.private boolean checkPassword(java.lang.String plain,
UserAccount user)
plain - plain text passworduser - UserAccount instancetrue if password is validprivate void agePassword(UserAccount user)
user - UserAccount instance