Class UsernamePasswordMechanism

    • Constructor Detail

      • UsernamePasswordMechanism

        public UsernamePasswordMechanism()
    • Method Detail

      • authenticate

        public final AuthenticationReply authenticate​(AuthenticationRequest request)
        This is the authentication method from the Policy Service to the actual implementation authentication method. Not of interest for an developer implementing a sub class.
        Parameters:
        request - The authentication request.
        Returns:
        The authentication reply.
      • exit

        public abstract boolean exit()
        This method is called during a termination of the Policy Service. This enables the authentication method developer to dispose any persistent connections or other resources that should be closed and finalized in a correct manner.
        Returns:
        True on success, false on failure.
      • init

        public final boolean init​(AuthenticationMechanismConfiguration configuration,
                                  AuthenticationMechanismHandler handler)
        This is the call from the Policy Service to the authentication method. Not of interest for an developer implementing a sub class.
        Specified by:
        init in interface AuthenticationMechanismInterface
        Overrides:
        init in class BaseAuthenticationPlugin
        Parameters:
        configuration - The configuration handler.
        handler - The authentication method handler.
        Returns:
        The authentication method should return true if it is ready to receive authentication requests. It should return false, if the authentication method already in this call can determine that it will be unable to perform authentication requests, e.g. if for instance a configuration parameter is missing.
      • authenticate

        protected abstract UsernamePasswordMechanism.UsernamePasswordMechanismResponse authenticate​(java.lang.String username,
                                                                                                    java.lang.String password)
        This is the progress of the authentication request to the actual authentication method implementation with just the username and password progressed to the authentication method.
        Parameters:
        username - The username.
        password - the password.
        Returns:
        A response object containing response codes.
      • initInternal

        protected abstract boolean initInternal​(AuthenticationMechanismConfiguration configuration,
                                                AuthenticationMechanismHandler handler)
        The init call to the authentication method. The same method parameters are progressed to the authentication method as in the AuthenticationMechanismInterface.
        Parameters:
        configuration - The configuration handler.
        handler - The authentication method handler.
        Returns:
        True if initialization went well. Should return false if any paramters are missing or inappropriate since then it is handled as a not loaded mechanism from then on.
      • testConnect

        protected abstract boolean testConnect()
        This method is called during initialization of the authentication method. Enables the extending class to set-up and initialize any MechanismServer objects received from configuration and determine whether these configured values corresponds to correct authentication servers. If returning false, the authentication service in Policy Service will regard this as non functioning and will not propagate any authentication requests.
        Returns:
        Should return true if ok, false if any error occurs and the authentication method is unable to perform the authentication service.