##// END OF EJS Templates
auth: add more login when performing sync of user groups.
marcink -
r2142:a23a4299 default
parent child Browse files
Show More
@@ -472,6 +472,7 b' class RhodeCodeExternalAuthPlugin(RhodeC'
472 # at this point _authenticate calls plugin's `auth()` function
472 # at this point _authenticate calls plugin's `auth()` function
473 auth = super(RhodeCodeExternalAuthPlugin, self)._authenticate(
473 auth = super(RhodeCodeExternalAuthPlugin, self)._authenticate(
474 userobj, username, passwd, settings, **kwargs)
474 userobj, username, passwd, settings, **kwargs)
475
475 if auth:
476 if auth:
476 # maybe plugin will clean the username ?
477 # maybe plugin will clean the username ?
477 # we should use the return value
478 # we should use the return value
@@ -540,6 +541,9 b' class RhodeCodeExternalAuthPlugin(RhodeC'
540 # field
541 # field
541 try:
542 try:
542 groups = auth['groups'] or []
543 groups = auth['groups'] or []
544 log.debug(
545 'Performing user_group sync based on set `%s` '
546 'returned by this plugin', groups)
543 UserGroupModel().enforce_groups(user, groups, self.name)
547 UserGroupModel().enforce_groups(user, groups, self.name)
544 except Exception:
548 except Exception:
545 # for any reason group syncing fails, we should
549 # for any reason group syncing fails, we should
@@ -593,7 +597,10 b' def authenticate(username, password, env'
593 headers_only = environ and not (username and password)
597 headers_only = environ and not (username and password)
594
598
595 authn_registry = get_authn_registry(registry)
599 authn_registry = get_authn_registry(registry)
596 for plugin in authn_registry.get_plugins_for_authentication():
600 plugins_to_check = authn_registry.get_plugins_for_authentication()
601 log.debug('Starting ordered authentication chain using %s plugins',
602 plugins_to_check)
603 for plugin in plugins_to_check:
597 plugin.set_auth_type(auth_type)
604 plugin.set_auth_type(auth_type)
598 plugin.set_calling_scope_repo(acl_repo_name)
605 plugin.set_calling_scope_repo(acl_repo_name)
599
606
General Comments 0
You need to be logged in to leave comments. Login now