Skip to main content

LinOTP2 modules for resolving usernames

Project description

LinOTP features a concept of UserIdResolvers. Such a module is used to convert a user object from any kind of user database to a distinct ID, that can be used by LinOTP to assign tokens to.

This package contains the base class for useridresolvers, the PasswdIdResolver (flat files), the LDAPIdResolver (OpenLDAP, AD, eDirectory) and the SQLIdResolver.

This package is used by the linotp package. For installation see the linotp package.

New classes can be written by inheriting the base class.

Base class

class UserIdResolver:

    fields = {"username":1, "userid":1,
              "description":0,
              "phone":0,"mobile":0,"email":0,
              "givenname":0,"surname":0,"gender":0
              }
    name = ""
    id = ""

    def __init(self):
        """ init - usual bootstrap hook
        """
        self.name = "UserIdResolver";

    def getUserId(self, loginName):
        """ getUserId(LoginName)
          - returns the identifier string
          - empty string if not exist

        """
        return self.id

    def getUsername(self, userid):
        """
        getUsername(LoginId)
          - returns the loginname string
          - empty string if not exist

        """

        return self.name

    def getUserInfo(self, userid):
        """
        getUserInfo(UserID)
            This function returns all user information for a given user object identified
            by UserID.
            Return value is a dictionary, if no object is found, the dictionary is empty
        """
        return ""

    def getResolverId(self):
        """ getResolverId(LoginName)
        - returns the resolver identifier string
          - empty string if not exist

        """
        """ print ">>" + LoginName; """
        return self.name

    def getResolverType(self):
        return ''


    def loadConfig(self, config, conf):
        return self

    def checkPass(self, uid, password):
        '''
        This function checks the password for a given uid.
        - returns true in case of success
        -         false if password does not match
        '''
        return False

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

LinOtpUserIdResolver-2.8.1.2.tar.gz (34.7 kB view details)

Uploaded Source

File details

Details for the file LinOtpUserIdResolver-2.8.1.2.tar.gz.

File metadata

File hashes

Hashes for LinOtpUserIdResolver-2.8.1.2.tar.gz
Algorithm Hash digest
SHA256 2e92756865b61a5623e5d5f83ab79d9bef2b7dea2639255ec6160d447aabb2b6
MD5 0689cc6053f640173db45e63e410c1f5
BLAKE2b-256 eb63e75390b5a1d69ff6dba189c49ae4935773a7ca618aebbda4cf87d8160fb9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page