15.2.1.2.6. mOTP Token

class privacyidea.lib.tokens.motptoken.MotpTokenClass(db_token)[source]

constructor - create a token object

Parameters

a_token (orm object) – instance of the orm db object

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

validate the token otp against a given otpvalue

Parameters
  • anOtpVal (str) – the to be verified otpvalue

  • counter (int) – the counter state, that should 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

static get_class_info(key=None, ret='all')[source]

returns a subtree of the token definition Is used by lib.token.get_token_info

Parameters
  • key (string) – subsection identifier

  • ret (user defined) – default return value, if nothing is found

Returns

subsection if key exists or user defined

:rtype : dict or string

static get_class_prefix()[source]
static get_class_type()[source]
get_init_detail(params=None, user=None)[source]

to complete the token normalisation, the response of the initialization should be build by the token specific method, the getInitDetails

update(param, reset_failcount=True)[source]

update - process initialization parameters

Parameters

param (dict) – dict of initialization parameters

Returns

nothing