summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorTdxdxoz <tdxdxoz@gmail.com>2020-09-25 19:01:45 +0800
committerGitHub <noreply@github.com>2020-09-25 07:01:45 -0400
commitabd04b6af0671517a01781c8bd10fef2a6c32cc4 (patch)
treec22cde6975ccfdfa3cfae58344869a79d26f2659 /synapse/config
parentFix schema delta for servers that have not backfilled (#8396) (diff)
downloadsynapse-abd04b6af0671517a01781c8bd10fef2a6c32cc4.tar.xz
Allow existing users to login via OpenID Connect. (#8345)
Co-authored-by: Benjamin Koch <bbbsnowball@gmail.com>

This adds configuration flags that will match a user to pre-existing users
when logging in via OpenID Connect. This is useful when switching to
an existing SSO system.
Diffstat (limited to 'synapse/config')
-rw-r--r--synapse/config/oidc_config.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/config/oidc_config.py b/synapse/config/oidc_config.py
index e0939bce84..70fc8a2f62 100644
--- a/synapse/config/oidc_config.py
+++ b/synapse/config/oidc_config.py
@@ -56,6 +56,7 @@ class OIDCConfig(Config):
         self.oidc_userinfo_endpoint = oidc_config.get("userinfo_endpoint")
         self.oidc_jwks_uri = oidc_config.get("jwks_uri")
         self.oidc_skip_verification = oidc_config.get("skip_verification", False)
+        self.oidc_allow_existing_users = oidc_config.get("allow_existing_users", False)
 
         ump_config = oidc_config.get("user_mapping_provider", {})
         ump_config.setdefault("module", DEFAULT_USER_MAPPING_PROVIDER)
@@ -158,6 +159,11 @@ class OIDCConfig(Config):
           #
           #skip_verification: true
 
+          # Uncomment to allow a user logging in via OIDC to match a pre-existing account instead
+          # of failing. This could be used if switching from password logins to OIDC. Defaults to false.
+          #
+          #allow_existing_users: true
+
           # An external module can be provided here as a custom solution to mapping
           # attributes returned from a OIDC provider onto a matrix user.
           #