Skip to content

Commit

Permalink
Add documentation to password_providers config option (matrix-org#7238)
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 authored and phil-flex committed Jun 16, 2020
1 parent 8068d87 commit 81df02c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/7238.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add documentation to the `password_providers` config option. Add known password provider implementations to docs.
5 changes: 4 additions & 1 deletion docs/password_auth_providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ into Synapse, and provides a number of methods by which it can integrate
with the authentication system.

This document serves as a reference for those looking to implement their
own password auth providers.
own password auth providers. Additionally, here is a list of known
password auth provider module implementations:

* [matrix-synapse-ldap3](https://github.com/matrix-org/matrix-synapse-ldap3/)

## Required methods

Expand Down
14 changes: 13 additions & 1 deletion docs/sample_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,19 @@ email:
#template_dir: "res/templates"


#password_providers:
# Password providers allow homeserver administrators to integrate
# their Synapse installation with existing authentication methods
# ex. LDAP, external tokens, etc.
#
# For more information and known implementations, please see
# https://github.com/matrix-org/synapse/blob/master/docs/password_auth_providers.md
#
# Note: instances wishing to use SAML or CAS authentication should
# instead use the `saml2_config` or `cas_config` options,
# respectively.
#
password_providers:
# # Example config for an LDAP auth provider
# - module: "ldap_auth_provider.LdapAuthProvider"
# config:
# enabled: true
Expand Down
16 changes: 14 additions & 2 deletions synapse/config/password_auth_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def read_config(self, config, **kwargs):
if ldap_config.get("enabled", False):
providers.append({"module": LDAP_PROVIDER, "config": ldap_config})

providers.extend(config.get("password_providers", []))
providers.extend(config.get("password_providers") or [])
for provider in providers:
mod_name = provider["module"]

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

def generate_config_section(self, **kwargs):
return """\
#password_providers:
# Password providers allow homeserver administrators to integrate
# their Synapse installation with existing authentication methods
# ex. LDAP, external tokens, etc.
#
# For more information and known implementations, please see
# https://github.com/matrix-org/synapse/blob/master/docs/password_auth_providers.md
#
# Note: instances wishing to use SAML or CAS authentication should
# instead use the `saml2_config` or `cas_config` options,
# respectively.
#
password_providers:
# # Example config for an LDAP auth provider
# - module: "ldap_auth_provider.LdapAuthProvider"
# config:
# enabled: true
Expand Down

0 comments on commit 81df02c

Please sign in to comment.