linotp.lib.apps module

This file contains utilities to generates the URL for smartphone apps like

google authenticator oath token

exception linotp.lib.apps.NoOtpAuthTokenException

Bases: Exception

linotp.lib.apps.create_google_authenticator(param: dict, user=None) str

Create the google url from the parameters

Parameters
  • param – dict containing the parameters

  • user – the user to which the token should be assigned

Returns

the google authenticator url

linotp.lib.apps.create_oathtoken_url(user, realm, otpkey, type='hmac', serial='')
linotp.lib.apps.google_authenticator_url(label, param)

create url for google authenticator

otpauth://TYPE/LABEL?PARAMETERS

remark: be aware of that the google authenticator does not support

other hash algorithms than ‘SHA1’ and no other digits like ‘6’!

remark: the counter value is respected by both, the google authenticator

and the free otp app

remark: currently the free otp app handles the issuer not correctly as the

issuer in the parameter list overrules the account in the LABEL

Parameters
  • label – the label for the url prefix

  • param – request dictionary

Returns

string with google url