linotp.tokens.motp.motptoken module¶
This file containes the mOTP token implementation: - http://motp.sourceforge.net/ -
- class linotp.tokens.motp.motptoken.MotpTokenClass(a_token)¶
Bases:
HmacTokenClass
implementation of the mOTP token class - see: http://motp.sourceforge.net/
- checkOtp(anOtpVal, counter, window, options=None)¶
checkOtp - validate the token otp against a given otpvalue
- Parameters
anOtpVal (string) – the to be verified otpvalue
counter (int) – the counter state, that shoule be verified
window (int) – the counter +window, which should be checked
options (dict) – the dict, which could contain token specific info
- Returns
the counter state or -1
- Return type
int
- classmethod getClassInfo(key=None, ret='all')¶
getClassInfo - returns all or a subtree of the token definition
- Parameters
key (string) – subsection identifier
ret (user defined) – default return value, if nothing is found
- Returns
subsection if key exists or user defined
:rtype : s.o.
- classmethod getClassPrefix()¶
- classmethod getClassType()¶
static method to return the token class identifier
- Returns
fixed string
- update(param, reset_failcount=True)¶
update - process initialization parameters
- Parameters
param (dict) – dict of initialization parameters
- Returns
nothing