linotp.controllers.gettoken module

gettoken controller - to retrieve OTP values

class linotp.controllers.gettoken.GettokenController(name, install_name='', **kwargs)

Bases: BaseController

The linotp.controllers are the implementation of the web-API to talk to the LinOTP server. The ValidateController is used to validate the username with its given OTP value.

The Tagespasswort Token uses this controller to retrieve the current OTP value of the Token and be able to set it in the application The functions of the GettokenController are invoked like this

https://server/gettoken/<functionname>

The functions are described below in more detail.

getmultiotp()

GET, POST /gettoken/getmultiotp

Deprecated since version 3.2: Requests using HTTP POST method (because it is only reading data). This endpoint will only be available via HTTP GET method in the future.

This function is used to retrieve multiple otp values for a given user or a given serial. If the user has more than one token, the list of the tokens is returend.

Parameters
  • serial – the serial number of the token

  • count – number of otp values to return

Returns

a json result with a boolean status and request result

Raises

Exception – if an error occurs an exception is serialized and returned

getotp()

GET, POST /gettoken/getotp

Deprecated since version 3.2: Requests using HTTP POST method (because it is only reading data). This endpoint will only be available via HTTP GET method in the future.

This function is used to retrieve the current otp value for a given user or a given serial. If the user has more than one token, the list of the tokens is returend.

Parameters
  • user – username / loginname

  • realm – additional realm to match the user to a useridresolver

  • serial – the serial number of the token

  • curTime – used ONLY for internal testing: datetime.datetime object

Returns

a json result with a boolean status and request result

Raises

Exception – if an error occurs an exception is serialized and returned