Exemple #1
0
def check_otp(token, otpval, options=None, pin=None):
    '''
    check the otp value

    :param otpval: the to be checked otp value
    :param options: the additional request parameters

    :return: result of the otp check, which is
            the matching otpcounter or -1 if not valid
    '''

    LOG.debug("[check_otp] entering function check_otp()")
    LOG.debug("[check_otp] token  : %r" % token)
    # This is only the OTP value, not the OTP PIN
    LOG.debug("[check_otp] OtpVal : %r" % otpval)

    res = -1

    counter = token.getOtpCount()
    window = token.getOtpCountWindow()

    res = token.checkOtp(otpval, counter, window, options=options, pin=pin)
    return res
Exemple #2
0
def check_otp(token, otpval, options=None):
    """
    check the otp value

    :param otpval: the to be checked otp value
    :param options: the additional request parameters

    :return: result of the otp check, which is
            the matching otpcounter or -1 if not valid
    """

    LOG.debug("[check_otp] entering function check_otp()")
    LOG.debug("[check_otp] token  : %r" % token)
    # This is only the OTP value, not the OTP PIN
    LOG.debug("[check_otp] OtpVal : %r" % otpval)

    res = -1

    counter = token.getOtpCount()
    window = token.getOtpCountWindow()

    res = token.checkOtp(otpval, counter, window, options=options)
    return res