Class ExampleChallenge
- java.lang.Object
-
- com.portwise.mvpnms.authentication.BaseAuthenticationPlugin
-
- com.portwise.mvpnms.authentication.example.ExampleChallenge
-
- All Implemented Interfaces:
AuthenticationMechanismInterface
public class ExampleChallenge extends BaseAuthenticationPlugin
Example of an authentication method that implements a challenge. The flow is: The default case challenges the user for "username". Then user replies with username, the authentication method responds with the "first" challenge for the "first password". If the user responds with same password as username, the authentication method replies with the "second" challenge for the "second password" which also has to be equal to the username. If equal in this second state the authentication method returns AUTHENTICATED. All other cases it returns NOT AUTHENTICATED.
-
-
Field Summary
-
Fields inherited from class com.portwise.mvpnms.authentication.BaseAuthenticationPlugin
sLogger
-
Fields inherited from interface com.portwise.mvpnms.authentication.AuthenticationMechanismInterface
ARG, AUTHENTICATED, AUTHORIZATION_PARAMETER, CA_STATUS_DISABLED, CA_STATUS_REVOKED, CERT_ERROR_MESSAGE, CERTIFICATE_ATTRIBUTE_MAPPING, CHALLENGE, CVC_FAILED_USER_CERTIFICATE, DO_PARAMETER, DOMAIN, IMAGE_DATA_URI, INVALID_CA_CERTIFICATE, INVALID_CREDENTIALS, INVALID_CRL, INVALID_USER_CERTIFICATE, MESSAGE, NO_CERTIFICATE, NO_PASSWORD, NO_USERNAME, NOT_AUTHENTICATED, NOT_AVAILABLE_SERVICE, NOT_BOUND_USER_CERTIFICATE, NOT_MAPPED_NO_UNIQUE_USER_FOUND, NOT_MAPPED_SUBJECT_DN_IN_CERT, NOT_MAPPED_USER_CERTIFICATE, PASSWORD, RADIUS_REPLY_MESSAGE, REVOKED_USER_CERTIFICATE, SERVER_INDEX, SHARED_SECRET, STATE, SVC_FAILED_USER_CERTIFICATE, TMP_MSG_BOX_URI, TVC_FAILED_CA_CERTIFICATE_EXPIRED, TVC_FAILED_CA_CERTIFICATE_NOT_YET_VALID, TVC_FAILED_USER_CERTIFICATE_EXPIRED, TVC_FAILED_USER_CERTIFICATE_NOT_YET_VALID, URL, USER_ATTRIBUTE_MAPPING, USERNAME, VENDOR
-
-
Constructor Summary
Constructors Constructor Description ExampleChallenge()
Constructor for the plugin.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticationReply
authenticate(AuthenticationRequest request)
Perform an authentication request.boolean
exit()
Termination.java.lang.String
getName()
Returns the name of the authentication method.boolean
init(AuthenticationMechanismConfiguration configuration, AuthenticationMechanismHandler handler)
Initialization of the authentication method.boolean
needsReloading(java.lang.String transactionKey)
-
Methods inherited from class com.portwise.mvpnms.authentication.BaseAuthenticationPlugin
addSessionAttribute, base64decode, clearSessionAttributes, getConfiguration, getConfigurationAttributeNameList, getConfigurationAttributeValue, getHandler, getNewSessionId, getRequestParameterValue, getSessionAttributeNameList, getSessionAttributeValue, getUserAttributeValue, getUsername
-
-
-
-
Method Detail
-
init
public boolean init(AuthenticationMechanismConfiguration configuration, AuthenticationMechanismHandler handler)
Initialization of the authentication method. The configuration is forwarded to the authentication method as well as the authentication handler which can assist the method for instance with session and logging issues.- Specified by:
init
in interfaceAuthenticationMechanismInterface
- Overrides:
init
in classBaseAuthenticationPlugin
- Parameters:
configuration
- The configuration handler.handler
- The authentication method handler.- Returns:
- The authentication method should return true, if ready to receive authentication requests. False, if authentication method already in this call can determine that it will be unable to perform authentication, if for instance a configuration parameter is missing.
-
authenticate
public AuthenticationReply authenticate(AuthenticationRequest request)
Perform an authentication request.- Parameters:
request
- The authentication request containing information on which the authentication can be based.- Returns:
- The authentication reply containing information about the success or failure of the authentication.
-
exit
public boolean exit()
Termination. Close down any persistent connections or other resources allocated during run-time of the mechanism.- Returns:
- True, if termination went well. False, if not sucessful.
-
getName
public java.lang.String getName()
Returns the name of the authentication method.- Returns:
- The name of the authentication method.
-
needsReloading
public boolean needsReloading(java.lang.String transactionKey)
-
-