def METHOD_NAME(self, otpval, counter=None, window=None, options=None):
    secret = self.token.get_otpkey().getKey()
    # vasco_otp_check expects a bytestring, so we encode ``otpval`` to bytes (should be ASCII anyway)
    result, new_secret = vasco_otp_check(secret, otpval.encode("utf-8"))
    # By default, setting a new OTP key resets the failcounter. In case of the VASCO token,
    # this would mean that the failcounter is reset at every authentication attempt
    # (regardless of success or failure), which must be avoided.
    self.token.set_otpkey(new_secret, reset_failcount=False)
    self.save()
    if result == 0:
        # Successful authentication
        return 0
    else:
        if result == 1:
            # wrong OTP value, no log message
            pass
        elif result == 201:
            log.warning("VASCO token failed to authenticate, code replay attempt, previous OTP value was used again!")
        elif result == 202:
            log.warning("Token-internal fail counter reached its maximum!")
        elif result == -202:
            log.warning("VASCO token failed to authenticate, response too small, user did not type his complete OTP!")
        elif result == -205:
            log.warning("VASCO token failed to authenticate, response not decimal!")
        else:
            log.warning("VASCO token failed to authenticate, result: {!r}".format(result))
        return -1