cubicweb/server/repository.py
changeset 11750 18e7b9829471
parent 11699 b48020a80dc3
child 11756 60fed6272771
equal deleted inserted replaced
11749:ae9789d77ea0 11750:18e7b9829471
   452         associated CWUser's eid on success.
   452         associated CWUser's eid on success.
   453         """
   453         """
   454         # iter on sources_by_uri then check enabled source since sources doesn't
   454         # iter on sources_by_uri then check enabled source since sources doesn't
   455         # contain copy based sources
   455         # contain copy based sources
   456         for source in self.sources_by_uri.values():
   456         for source in self.sources_by_uri.values():
   457             if self.config.source_enabled(source) and source.support_entity('CWUser'):
   457             if self.config.source_enabled(source):
   458                 try:
   458                 try:
   459                     return source.authenticate(cnx, login, **authinfo)
   459                     return source.authenticate(cnx, login, **authinfo)
   460                 except AuthenticationError:
   460                 except (NotImplementedError, AuthenticationError):
   461                     continue
   461                     continue
   462         else:
   462         else:
   463             raise AuthenticationError('authentication failed with all sources')
   463             raise AuthenticationError('authentication failed with all sources')
   464 
   464 
   465     def authenticate_user(self, cnx, login, **authinfo):
   465     def authenticate_user(self, cnx, login, **authinfo):