com.ibm.commerce.security.commands

Class AuthenticationPolicyCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, AuthenticationPolicyCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class AuthenticationPolicyCmdImpl
    extends TaskCommandImpl
    implements AuthenticationPolicyCmd

    Use this task command to enforce policies such as minimum password length. This task command is called by every command that performs verification or update of user credentials.

    Before executing this task command, the methods listed below must be invoked.

    • setLogonId
    • setPassword
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright statement
        See Also:
        Constant Field Values
      • ERRTASK_NAME

        public static java.lang.String ERRTASK_NAME
        Error task name.
    • Constructor Detail

      • AuthenticationPolicyCmdImpl

        public AuthenticationPolicyCmdImpl()
    • Method Detail

      • isPasswordCompliant

        public boolean isPasswordCompliant()
        After this task is executed, this method returns whether the user had a password policy and if the supplied password complies with that policy. If the user had a password policy and there is non-compliance then an exception is thrown.
        Specified by:
        isPasswordCompliant in interface AuthenticationPolicyCmd
        Returns:
        True if password complies with the user's password policy.
      • performExecute

        public void performExecute()
                            throws ECException
        This command fetches the password policies and delegates to the validatePasswordCompliance() method to determine if the password specified satisfies the policies. It terminates normally if the password matches the criteria and throws an ECApplicationException if a policy violation is detected. This method requires the following parameters to be set.
        • Security/PasswordPolicy parameter to be set to true.
        • MemberSubSystem/AuthenticationMode to be set to DB in the instance.xml file and to use database authentication.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException - thrown if a password policy violation is detected.
      • setAccountPolicy

        public void setAccountPolicy(java.lang.String strDefinedAccountPolicy)
        This method sets the account policy used to check this password. This overrides the default account policy for the user.
        Specified by:
        setAccountPolicy in interface AuthenticationPolicyCmd
        Parameters:
        strDefinedAccountPolicy - The account policy.
      • setErrorTask

        public void setErrorTask(java.lang.String strErrorTask)
        This function allows for the default error view task of the command to be overwritten.
        Specified by:
        setErrorTask in interface AuthenticationPolicyCmd
        Parameters:
        strErrorTask - The name of the new error view task.
      • setLogonId

        public void setLogonId(java.lang.String strLogonId)
        This method sets the logon ID under which the current user wishes to logon.
        Specified by:
        setLogonId in interface AuthenticationPolicyCmd
        Parameters:
        strLogonId - The login ID.
      • setPassword

        public void setPassword(java.lang.String strPassword)
        This method sets the password to use for authentication with the new logon ID.
        Specified by:
        setPassword in interface AuthenticationPolicyCmd
        Parameters:
        strPassword - The password.