linotp.lib.request module

support redirecting requests to remote systems on base of policy defintion

class linotp.lib.request.HttpRequest(server, env=None)

Bases: RemoteRequest

HTTP request forwarding handler

do_request(user, password, options=None)

run the http request against the remote host

Parameters
  • user – the requesting user (required)

  • password – the password which should be checked on the remote host

  • options – dict which provides additional request parameter. e.g for challenge response

Returns

Tuple of (success, and reply=remote response)

class linotp.lib.request.RadiusRequest(server, env=None)

Bases: RemoteRequest

Radius request forwarding handler

do_request(user, password, options=None)

run the radius request against the remote host

Parameters
  • user – the requesting user (required)

  • password – the password which should be checked on the remote host

  • options – dict which provides additional request parameter. e.g for challenge response

Returns

Tuple of (success, and reply=remote response)

class linotp.lib.request.RemoteRequest(server, env=None)

Bases: object

Request is the class to handle the forwarding of request to external, remote sources and servers. Supported is currently either requests to a Radius server or requests to an remote LinOTP server via http. The forwarding server defintion is done in the forward policy, where a server is defined in the URI format.

action:

forward_server= http://localhost:5001/validate/check

for defining a radius server connection is as well required to define the password for the symetric connection, the secret. The secret could be provided as an additional parameter to the radius server url.

action:

forward_server= radius://localhost:1812/?secret=shared_secret

static parse_url(url)