Skip to content

Commit 81df02c

Browse files
anoadragon453phil-flex
authored andcommitted
Add documentation to password_providers config option (matrix-org#7238)
1 parent 8068d87 commit 81df02c

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

changelog.d/7238.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add documentation to the `password_providers` config option. Add known password provider implementations to docs.

docs/password_auth_providers.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ into Synapse, and provides a number of methods by which it can integrate
99
with the authentication system.
1010

1111
This document serves as a reference for those looking to implement their
12-
own password auth providers.
12+
own password auth providers. Additionally, here is a list of known
13+
password auth provider module implementations:
14+
15+
* [matrix-synapse-ldap3](https://github.com/matrix-org/matrix-synapse-ldap3/)
1316

1417
## Required methods
1518

docs/sample_config.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,19 @@ email:
16571657
#template_dir: "res/templates"
16581658

16591659

1660-
#password_providers:
1660+
# Password providers allow homeserver administrators to integrate
1661+
# their Synapse installation with existing authentication methods
1662+
# ex. LDAP, external tokens, etc.
1663+
#
1664+
# For more information and known implementations, please see
1665+
# https://github.com/matrix-org/synapse/blob/master/docs/password_auth_providers.md
1666+
#
1667+
# Note: instances wishing to use SAML or CAS authentication should
1668+
# instead use the `saml2_config` or `cas_config` options,
1669+
# respectively.
1670+
#
1671+
password_providers:
1672+
# # Example config for an LDAP auth provider
16611673
# - module: "ldap_auth_provider.LdapAuthProvider"
16621674
# config:
16631675
# enabled: true

synapse/config/password_auth_providers.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def read_config(self, config, **kwargs):
3535
if ldap_config.get("enabled", False):
3636
providers.append({"module": LDAP_PROVIDER, "config": ldap_config})
3737

38-
providers.extend(config.get("password_providers", []))
38+
providers.extend(config.get("password_providers") or [])
3939
for provider in providers:
4040
mod_name = provider["module"]
4141

@@ -52,7 +52,19 @@ def read_config(self, config, **kwargs):
5252

5353
def generate_config_section(self, **kwargs):
5454
return """\
55-
#password_providers:
55+
# Password providers allow homeserver administrators to integrate
56+
# their Synapse installation with existing authentication methods
57+
# ex. LDAP, external tokens, etc.
58+
#
59+
# For more information and known implementations, please see
60+
# https://github.com/matrix-org/synapse/blob/master/docs/password_auth_providers.md
61+
#
62+
# Note: instances wishing to use SAML or CAS authentication should
63+
# instead use the `saml2_config` or `cas_config` options,
64+
# respectively.
65+
#
66+
password_providers:
67+
# # Example config for an LDAP auth provider
5668
# - module: "ldap_auth_provider.LdapAuthProvider"
5769
# config:
5870
# enabled: true

0 commit comments

Comments
 (0)