def METHOD_NAME(self, configurationAttributes, requestParameters, step):
    userService = CdiUtil.bean(UserService)
    authenticationService = CdiUtil.bean(AuthenticationService)
    identity = CdiUtil.bean(Identity)
    credentials = identity.getCredentials()
    user_name = credentials.getUsername()
    if (step == 1):
        print "Basic (with password update). Authenticate for step 1"
        facesMessages = CdiUtil.bean(FacesMessages)
        facesMessages.setKeepMessages()
        user_password = credentials.getPassword()
        logged_in = False
        if (StringHelper.isNotEmptyString(user_name) and StringHelper.isEmptyString(user_password)):
            facesMessages.add(FacesMessage.SEVERITY_INFO, "Password is empty! Enter your password")
            print "Basic. Authenticate: Password is empty! Enter your password"
            return False
        if (StringHelper.isNotEmptyString(user_name) and StringHelper.isNotEmptyString(user_password)):
            find_user = userService.getUser(user_name)
            if (find_user == None):
                facesMessages.add(FacesMessage.SEVERITY_INFO, "User doesn't Exist")
                return False
            else:
                print "Basic . Authenticate for step 1-4-disablechecking"
                user_status = userService.getCustomAttribute(find_user, "gluuStatus")
                print "Basic . Authenticate for step 1-5-disablechecking"
                if (user_status != None):
                    user_status_value = user_status.getValue()
                    if (StringHelper.equals(user_status_value, "inactive")): 
                        facesMessages.add(FacesMessage.SEVERITY_INFO, "User is Disabled")                            
                        return False 	
        if (StringHelper.isNotEmptyString(user_name) and StringHelper.isNotEmptyString(user_password)):
            logged_in = authenticationService.METHOD_NAME(user_name, user_password)
        if (not logged_in):
            return False
        return True
    elif (step == 2):
        print "Basic (with password update). Authenticate for step 2-see"
        user = authenticationService.getAuthenticatedUser()
        facesMessages = CdiUtil.bean(FacesMessages)
        facesMessages.setKeepMessages()
        if user == None:
            print "Basic (with password update). Authenticate for step 2. Failed to determine user name"
            return False
        user_name = user.getUserId()
        find_user_by_uid = userService.getUser(user_name)
        update_button = requestParameters.get("loginForm:updateButton")
        if ArrayHelper.isEmpty(update_button):
            return True
        new_password_array = requestParameters.get("loginForm:password")
        new_password = new_password_array[0]  
        if ArrayHelper.isEmpty(new_password_array) or StringHelper.isEmpty(new_password):
            print "Basic (with password update). Authenticate for step 2. New password is empty"
            return False
        print "Basic (with password update). Authenticate for step 2. see the new password ================'%s'" % new_password
        results = zxcvbn(new_password)
        if results['score'] <2:
            print 'Its a weak Password, please increase the complexity.'
            facesMessages.add(FacesMessage.SEVERITY_INFO, "Its weak password, please increase the complexity.")
            return False
        find_user_by_uid.setAttribute("userPassword", new_password)
        print "Basic (with password update). Authenticate for step 2. Attempting to set new user '%s' password " % user_name
        userService.updateUser(find_user_by_uid)
        print "Basic (with password update). Authenticate for step 2. Password updated successfully"
        return True
    else:
        return False