linotp.provider.smsprovider package

Module contents

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[source]

Bases: object

Interface class for the SMS providers

classmethod getClassInfo(key=None)[source]
static getConfigMapping()[source]

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)[source]
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)[source]
provider_type = 'sms'
submitMessage(phone, message)[source]
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)[source]

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