6.1.1.3.1.5.1.7. linotp.lib.tokens.remotetoken module¶
This file file contains the Remote token class
- class linotp.lib.tokens.remotetoken.RemoteTokenClass(aToken)[source]¶
Bases: linotp.lib.tokenclass.TokenClass
The Remote token forwards an authentication request to another LinOTP server. The request can be forwarded to a user on the other server or to a serial number on the other server. The PIN can be checked on the local LinOTP server or on the remote server.
Using the Remote token you can assign one physical token to many different users.
- authenticate(passw, user, options=None)[source]¶
do the authentication on base of password / otp and user and options, the request parameters.
Here we contact the other LinOTP server to validate the OtpVal.
Parameters: - passw – the password / otp
- user – the requesting user
- options – the additional request parameters
Returns: tupple of (success, otp_count - 0 or -1, reply)
- checkPin(pin, options=None)[source]¶
check the pin - either remote or localy - in case of remote, we return true, as the
the splitPinPass will put the passw then in the otpVal
- checkResponse4Challenge(user, passw, options=None, challenges=None)[source]¶
This method verifies if the given passw matches any existing challenge of the token.
It then returns the new otp_counter of the token and the list of the matching challenges.
In case of success the otp_counter needs to be >= 0. The matching_challenges is passed to the method challenge_janitor() to clean up challenges.
Parameters: - user (User object) – the requesting user
- passw (string) – the password (pin+otp)
- options (dict) – additional arguments from the request, which could be token specific
- challenges (list) – A sorted list of valid challenges for this token.
Returns: tuple of (otpcounter and the list of matching challenges)
- do_request(passw, transactionid=None, user=None)[source]¶
run the http request against the remote host
Parameters: - passw – the password which should be checked on the remote host
- transactionid – provided, if this is a challenge response
- user – the requesting user - used if no remote serial or remote user is provided
Returns: Tuple of (success, otp_count= -1 or 0, reply=remote response)
- classmethod getClassInfo(key=None, ret='all')[source]¶
getClassInfo - returns a subtree of the token definition
Parameters: - key (string) – subsection identifier
- ret (user defined) – default return value, if nothing is found
Returns: subsection if key exists or user defined
Return type: s.o.
- is_challenge_request(passw, user, options=None)[source]¶
This method checks, if this is a request, that triggers a challenge. It depends on the way, the pin is checked - either locally or remote
Parameters: - passw (string) – password, which might be pin or pin+otp
- user (User object) – The user from the authentication request
- options (dict) – dictionary of additional request parameters
Returns: true or false