def authenticateCredentials(self, credentials): login = credentials.get('login') password = credentials.get('password') if login is None or password is None: return None # Adapt to IUserAuthentication to provide the actual authentication. # If no such adapter (or null-adapter) exists, fail. authentication = IUserAuthentication(self.context, None) if authentication is None: return None if authentication.verifyCredentials(credentials): info = IMembraneUserObject(self.context, self) userid = info.getUserId() return userid, login
def getUserId(obj): obj = IMembraneUserObject(obj, None) if obj is None: return None return obj.getUserId()