5.4. UserIdResolver Modules

If you need to develop a new useridresolver that is to be loaded into LinOTP, this useridresolver needs to be a Python class, that inherits from the Python class UserIdResolver. Here you may find the minimum set of methods that needs to be implemented here:

For an detailed example, how these methods get implemented, you may consult the interface and implementation of the PasswdIdResolver:

Please note, that new UserIdResolvers need to comply with the AGPLv3 License and need also to be published under the AGPLv3 License.

class useridresolver.UserIdResolver.UserIdResolver[source]
checkPass(uid, password)[source]

This function checks the password for a given uid. - returns true in case of success - false if password does not match

close()[source]

Hook to close down the resolver after one request

classmethod getResolverClassDescriptor()[source]

return the descriptor of the resolver, which is - the class name and - the config description

Returns:resolver description dict
Return type:dict
classmethod getResolverClassType()[source]

provide the resolver type for registration

getResolverDescriptor()[source]

return the descriptor of the resolver, which is - the class name and - the config description

Returns:resolver description dict
Return type:dict
getResolverId()[source]

get resolver specific information :return: the resolver identifier string - empty string if not exist

getResolverType()[source]

getResolverType - return the type of the resolver

Returns:returns the string ‘ldapresolver’
Return type:string
getUserId(LoginName)[source]
  • returns the identifier string
  • empty string if not exist
getUserInfo(userid)[source]

This function returns all user information for a given user object identified by UserID.

Returns:dictionary, if no object is found, the dictionary is empty
getUserList(serachDict)[source]

This function finds the user objects, that have the term ‘value’ in the user object field ‘key’

Parameters:searchDict – dict with key values of user attributes - the key may be something like ‘loginname’ or ‘email’ the value is a regular expression.
Returns:list of dictionaries (each dictionary contains a user object) or an empty string if no object is found.
getUsername(LoginId)[source]
  • returns the loginname string
  • empty string if not exist