6.1.1.3.2.31. linotp.lib.user module

contains user - related functions

class linotp.lib.user.User(login='', realm='', conf='')[source]

Bases: object

addResolverUId(resolver, uid, conf='', resId='', resCId='')[source]
getRealm()[source]
getResConf()[source]
getResolverConf(resolver)[source]
getResolverUId(resolver)[source]
getResolvers()[source]
getUser()[source]
isEmpty()[source]
saveResolvers(resolvers)[source]

save the resolver objects as list as part of the user

linotp.lib.user.check_user_password(username, realm, password)[source]

This is a helper function to check the username and password against a userstore.

return

success — This is the username of the authenticated user. If unsuccessful,
returns None
linotp.lib.user.getConf(Realms, Conf)[source]

extract the configguration part from the resolver definition

linotp.lib.user.getRealmBox()[source]

returns the config value of selfservice.realmbox. if True, the realmbox in the selfservice login will be displayed. if False, the realmbox will not be displayed and the user needs to login via user@realm

linotp.lib.user.getResolvers(user)[source]

get the list of the Resolvers within a users.realm or from the resolver conf, if given in the user object

Note :It ignores the user.login attribute!
Parameters:user (User object) – User with realm or resolver conf
linotp.lib.user.getResolversOfUser(user)[source]

This returns the list of the Resolvers of a user in a given realm. Usually this should only return one resolver

input:
user.login, user.realm
returns:
array of resolvers, the user was found in
linotp.lib.user.getSearchFields(User)[source]
linotp.lib.user.getUserFromParam(param, optionalOrRequired)[source]
linotp.lib.user.getUserFromRequest(request)[source]

This function first tries to get the user from * a DigestAuth and otherwise from * basic auth and otherwise from * the client certificate

linotp.lib.user.getUserId(userObject)[source]

return (uid,resId,resIdC)

linotp.lib.user.getUserInfo(userid, resolver, resolverC)[source]
linotp.lib.user.getUserList(param, User)[source]
linotp.lib.user.getUserPhone(user, phone_type='phone')[source]

Returns the phone numer of a user

Parameters:
  • user (user object) – the user with the phone
  • phone_type (string) – The type of the phone, i.e. either mobile or phone (land line)
Returns:

list with phone numbers of this user object

linotp.lib.user.getUserRealms(user)[source]

Returns the realms, a user belongs to. If the user has no realm but only a useridresolver, than all realms, containing this resolver are returned. This function is used for the policy module

linotp.lib.user.getUserResolverId(user, report=False)[source]
linotp.lib.user.setRealm(realm, resolvers)[source]
linotp.lib.user.splitUser(username)[source]