def METHOD_NAME(self, configurationAttributes, requestParameters, step):
    identity = CdiUtil.bean(Identity)
    session_attributes = identity.getSessionId().getSessionAttributes()
    authenticationService = CdiUtil.bean(AuthenticationService)
    allowedCountriesListArray = StringHelper.split(self.allowedCountries, ",")
    if (len(allowedCountriesListArray) > 0 and session_attributes.containsKey("remote_ip")):
        remote_ip = session_attributes.get("remote_ip")
 remote_loc_dic = self.determineGeolocationData(remote_ip)
 if remote_loc_dic == None:
     print "Super-Gluu. Prepare for step 2. Failed to determine remote location by remote IP '%s'" % remote_ip
     return
 remote_loc = "%s" % ( remote_loc_dic['countryCode'])
        print "Your remote location is "+remote_loc
        if remote_loc in allowedCountriesListArray:
            print "you are allowed to access"
        else:
            return False
    if (step == 1):
        print "Basic. Authenticate for step 1"
        identity = CdiUtil.bean(Identity)
        credentials = identity.getCredentials()
        user_name = credentials.getUsername()
        user_password = credentials.getPassword()
        logged_in = 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
    else:
        return False