14.2.6. PinHandler

This module provides the PIN Handling base class. In case of enrolling a token, a PIN Handling class can be used to send the PIN via Email, call an external program or print a letter.

This module is not tested explicitly. It is tested in conjunction with the policy decorator init_random_pin in tests/test_api_lib_policy.py

14.2.6.1. Base class

class edumfa.lib.pinhandling.base.PinHandler(options=None)[source]

A PinHandler Class is responsible for handling the OTP PIN during enrollment.

It receives the necessary data like
  • the PIN

  • the serial number of the token

  • the username

  • all other user data:

    • given name, surname

    • email address

    • telephone

    • mobile (if the module would deliver via SMS)

  • the administrator name (who enrolled the token)

send(pin, serial, user, tokentype=None, logged_in_user=None, userdata=None, options=None)[source]
Parameters:
  • pin – The PIN in cleartext

  • user (user object) – the owner of the token

  • tokentype (basestring) – the type of the token

  • logged_in_user (dict) – The logged in user, who enrolled the token

  • userdata (dict) – Handler-specific user data like email, mobile…

  • options (dict) – Handler-specific additional options

Returns:

True in case of success

Return type:

bool