Merge pull request #5432 from FinnStutzenstein/fixSaml
Fix SAML default group ids setting
This commit is contained in:
commit
81b021ab47
6
.gitignore
vendored
6
.gitignore
vendored
@ -14,7 +14,10 @@ node_modules/*
|
||||
bower_components/*
|
||||
|
||||
# OS4-Submodules
|
||||
openslides-*
|
||||
/openslides-*
|
||||
|
||||
# OS3+
|
||||
/server/
|
||||
|
||||
# Local user data (settings, database, media, search index, static files)
|
||||
personal_data/*
|
||||
@ -81,6 +84,7 @@ client/yarn.lock
|
||||
package-lock.json
|
||||
client/package-lock.json
|
||||
cypress.json
|
||||
*-version.txt
|
||||
|
||||
# System Files
|
||||
client/.DS_Store
|
||||
|
@ -82,6 +82,6 @@ One can overwrite the data extracted from the request headers of saml-requests.
|
||||
|
||||
### Default group ids
|
||||
|
||||
If the optional key `default_group_ids` is given, these groups are assigned to
|
||||
If the optional key `defaultGroupIds` is given, these groups are assigned to
|
||||
each new created user on each saml login. It must be a list of ids. To disable
|
||||
this feature, either just do not inlcude this key, or set it to `null`.
|
||||
|
@ -214,7 +214,7 @@ class SamlSettings:
|
||||
raise SamlException('The https value must be "on" or "off"')
|
||||
|
||||
def load_default_group_ids(self, content):
|
||||
self.default_group_ids = content.pop("default_group_ids", None)
|
||||
self.default_group_ids = content.pop("defaultGroupIds", None)
|
||||
if self.default_group_ids is None:
|
||||
return
|
||||
if not isinstance(self.default_group_ids, list):
|
||||
|
@ -145,7 +145,7 @@ class SamlView(View):
|
||||
)
|
||||
group_ids = get_saml_settings().default_group_ids
|
||||
if group_ids:
|
||||
user.groups.add(group_ids)
|
||||
user.groups.add(*group_ids)
|
||||
inform_changed_data(user) # put the new user into the cache
|
||||
else:
|
||||
logger.info(
|
||||
|
Loading…
Reference in New Issue
Block a user