Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Add a check for duplicate IdP ids #9184

Merged
merged 2 commits into from
Jan 21, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update out-of-date-comment
#9189 makes this comment redundant.
  • Loading branch information
richvdh committed Jan 21, 2021
commit ac3d44df0750fe3ada62de74bbc8662c55f8e17f
7 changes: 3 additions & 4 deletions synapse/config/oidc_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ def read_config(self, config, **kwargs):
except DependencyException as e:
raise ConfigError(e.message) from e

# check we don't have any duplicate idp_ids
# XXX: this won't detect clashes with other IdP providers using other SSO
# mechanisms (such as SAML or CAS); that will be detected when we set up the
# listeners but by then synapse will have forked, so it's not ideal.
# check we don't have any duplicate idp_ids now. (The SSO handler will also
# check for duplicates when the REST listeners get registered, but that happens
# after synapse has forked so doesn't give nice errors.)
c = Counter([i.idp_id for i in self.oidc_providers])
for idp_id, count in c.items():
if count > 1:
Expand Down