linotp.tokens.motptoken module

This file containes the mOTP token implementation: - -

class linotp.tokens.motp.motptoken.MotpTokenClass(a_token)[source]

Bases: linotp.tokens.base.TokenClass

implementation of the mOTP token class - see:

checkOtp(anOtpVal, counter, window, options=None)[source]

checkOtp - validate the token otp against a given otpvalue

  • 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

the counter state or -1

Return type:


classmethod getClassInfo(key=None, ret='all')[source]

getClassInfo - returns all or a subtree of the token definition

  • key (string) – subsection identifier
  • ret (user defined) – default return value, if nothing is found

subsection if key exists or user defined

:rtype : s.o.

classmethod getClassPrefix()[source]
classmethod getClassType()[source]

static method to return the token class identifier

Returns:fixed string
update(param, reset_failcount=True)[source]

update - process initialization parameters

Parameters:param (dict) – dict of initialization parameters