linotp.provider.smsprovider package

LinOTP is an open solution for strong two-factor authentication

with One Time Passwords.

SMSProvider is the iterface to the final sms submitting service LinOTP provides 3 types of implementation: HTTPSMS, SMTP and Device sms submitt.

class linotp.provider.smsprovider.ISMSProvider

Bases: object

Interface class for the SMS providers

DEFAULT_TIMEOUT = 5
classmethod getClassInfo(key=None)
static getConfigMapping()

for dynamic, adaptive config entries we provide the abilty to have dedicated config entries

entries should look like: {

key: (ConfigName, ConfigType)

}

static get_bool(config, key, default)
helper method - get the boolean value from a config entry,

which could be either boolean or string

as we might get from the json a real boolean or a string, we use the %r to print the representation to generalize the processing

loadConfig(configDict)
provider_type = 'sms'
submitMessage(phone, message)
submitMessage - the method of all SMS Providers after preparation

the subclass method of _submitMessage() is called

Parameters
  • phone – the unformatted, arbitrary phone number

  • message – the message that should be submitted

Returns

boolean value of success

linotp.provider.smsprovider.getSMSProviderClass(packageName, className)

helper method to load the SMSProvider class from a given package in literal: checks, if the submittMessage method exists else an error is thrown

example:

getSMSProviderClass(“SkypeSMSProvider”, “SMSProvider”)()

Returns

the SMS provider object