hello thanks for your help. I am doing a new pluging for PAS, I need take users and login for Plone. To do it, i did this class: class ValidaPlugin(BasePlugin): """ PAS plugin """ uservar = 'X_REMOTE_USER' meta_type = 'ValidaPlugin' security = ClassSecurityInfo() _properties = ({'id':'uservar','type':'string'},) def __init__(self, id, title=None): self._id = self.id = id self.title = title security.declarePrivate('authenticateCredentials') def authenticateCredentials(self, credentials): """ Authentication Part """ login = credentials.get('login', '') password = credentials.get('password', '') return login, login classImplements(ValidaPlugin, IAuthenticationPlugin) InitializeClass(ValidaPlugin) it work bad, it start with everything i put on username and password, it don´t validate if user exist. How can i do it???
security.declarePrivate('authenticateCredentials') def authenticateCredentials(self, credentials): """ Authentication Part """ login = credentials.get('login', '') password = credentials.get('password', '') return login, login
it work bad, it start with everything i put on username and password, it don´t validate if user exist. How can i do it??? I don't understand what you're doing. Can describe your use case, please?
So far I know that you want to 'validate if user exists', but where are your users defined? RDBMS? ZODB? You should have plugin that implements: IUserAdderPlugin interface. What plugin is this in your environment? Take a look at plugins/ZODBUserManager. This plugin has three attributes: self._user_passwords = OOBTree() self._login_to_userid = OOBTree() self._userid_to_login = OOBTree() and it stores user data there. Then it's authenticateCredentials is able to check if user with specific login and password exists there. -- Maciej Wisniowski
participants (2)
-
javi lopez -
Maciej Wisniowski