Skip to content

Commit 1b27412

Browse files
Migrate README to markdown (#196)
Co-authored-by: Eric Eastwood <[email protected]>
1 parent 1cb8d10 commit 1b27412

File tree

1 file changed

+56
-48
lines changed

1 file changed

+56
-48
lines changed

README.rst renamed to README.md

Lines changed: 56 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,37 @@
1-
Synapse LDAP Auth Provider
2-
==========================
1+
# Synapse LDAP Auth Provider
32

43
Allows synapse to use LDAP as a password provider.
54

65
This allows users to log in to synapse with their username and password from an
7-
LDAP server. There is also `ma1sd <https://github.com/ma1uta/ma1sd>`_ (3rd party)
6+
LDAP server. There is also [ma1sd](https://github.com/ma1uta/ma1sd) (3rd party)
87
that offers more fully-featured integration.
98

10-
Installation
11-
------------
12-
- Included as standard in the `deb packages <https://matrix-org.github.io/synapse/latest/setup/installation.html#matrixorg-packages>`_ and
13-
`docker images <https://matrix-org.github.io/synapse/latest/setup/installation.html#docker-images-and-ansible-playbooks>`_ from matrix.org.
9+
> [!WARNING]
10+
> Synapse's password provider plugin functionality (which this module relies on)
11+
> is not compatible with [Matrix Authentication
12+
> Service](https://github.com/element-hq/matrix-authentication-service) (MAS), the
13+
> next-gen Matrix auth server.
14+
>
15+
> To use Synapse and MAS together with an LDAP backend, it is recommended to use
16+
> [Dex](https://github.com/dexidp/dex) with [MAS](https://github.com/element-hq/matrix-authentication-service), instead of
17+
> `matrix-synapse-ldap3`. See [the relevant MAS
18+
> documentation](https://element-hq.github.io/matrix-authentication-service/setup/migration.html#map-any-upstream-sso-providers)
19+
> for information on configuring Dex in MAS.
20+
21+
## Installation
22+
23+
- Included as standard in the [deb packages](https://matrix-org.github.io/synapse/latest/setup/installation.html#matrixorg-packages) and
24+
[docker images](https://matrix-org.github.io/synapse/latest/setup/installation.html#docker-images-and-ansible-playbooks) from matrix.org.
1425
- If you installed into a virtualenv:
1526
- Ensure pip is up-to-date: `pip install -U pip`.
1627
- Install the LDAP password provider: `pip install matrix-synapse-ldap3`.
1728
- For other installation mechanisms, see the documentation provided by the maintainer.
1829

19-
Usage
20-
-----
30+
## Usage
2131

2232
Example Synapse configuration:
2333

24-
.. code:: yaml
25-
34+
```yaml
2635
modules:
2736
- module: "ldap_auth_provider.LdapAuthProviderModule"
2837
config:
@@ -43,12 +52,12 @@ Example Synapse configuration:
4352
# local_certificate_file: foo.crt
4453
# local_private_key_file: bar.pem
4554
# local_private_key_password: secret
55+
```
4656

4757
If you would like to specify more than one LDAP server for HA, you can provide uri parameter with a list.
4858
Default HA strategy of ldap3.ServerPool is employed, so first available server is used.
4959

50-
.. code:: yaml
51-
60+
```yaml
5261
modules:
5362
- module: "ldap_auth_provider.LdapAuthProviderModule"
5463
config:
@@ -70,13 +79,13 @@ Default HA strategy of ldap3.ServerPool is employed, so first available server i
7079
# local_certificate_file: foo.crt
7180
# local_private_key_file: bar.pem
7281
# local_private_key_password: secret
82+
```
7383

7484
If you would like to enable login/registration via email, or givenName/email
7585
binding upon registration, you need to enable search mode. An example config
7686
in search mode is provided below:
7787

78-
.. code:: yaml
79-
88+
```yaml
8089
modules:
8190
- module: "ldap_auth_provider.LdapAuthProviderModule"
8291
config:
@@ -98,39 +107,38 @@ in search mode is provided below:
98107
# local_certificate_file: foo.crt
99108
# local_private_key_file: bar.pem
100109
# local_private_key_password: secret
110+
```
101111

102-
Alternatively you can also put the ``bind_password`` of your service user into its
112+
Alternatively you can also put the `bind_password` of your service user into its
103113
own file to not leak secrets into your configuration:
104114

105-
.. code:: yaml
106-
115+
```yaml
107116
modules:
108117
- module: "ldap_auth_provider.LdapAuthProviderModule"
109118
config:
110119
enabled: true
111120
# all the other options you need
112121
bind_password_file: "/var/secrets/synapse-ldap-bind-password"
122+
```
113123
114-
Please note that every trailing ``\n`` in the password file will be stripped automatically.
124+
Please note that every trailing `\n` in the password file will be stripped automatically.
115125

116-
Active Directory forest support
117-
-------------------------------
126+
## Active Directory forest support
118127

119-
If the ``active_directory`` flag is set to ``true``, an Active Directory forest will be
128+
If the ``active_directory`` flag is set to `true`, an Active Directory forest will be
120129
searched for the login details.
121130
In this mode, the user enters their login details in one of the forms:
122131

123-
- ``<login>/<domain>``
124-
- ``<domain>\<login>``
132+
- `<login>/<domain>`
133+
- `<domain>\<login>`
125134

126-
In either case, this will be mapped to the Matrix UID ``<login>/<domain>`` (The
127-
normal AD domain separators, ``@`` and ``\``, cannot be used in Matrix User Identifiers, so
128-
``/`` is used instead.)
135+
In either case, this will be mapped to the Matrix UID `<login>/<domain>` (The
136+
normal AD domain separators, `@` and `\`, cannot be used in Matrix User Identifiers, so
137+
`/` is used instead.)
129138

130-
Let's say you have several domains in the ``example.com`` forest:
131-
132-
.. code:: yaml
139+
Let's say you have several domains in the `example.com` forest:
133140

141+
```yaml
134142
modules:
135143
- module: "ldap_auth_provider.LdapAuthProviderModule"
136144
config:
@@ -148,46 +156,46 @@ Let's say you have several domains in the ``example.com`` forest:
148156
name: "givenName"
149157
bind_dn: "cn=hacker,ou=svcaccts,dc=example,dc=com"
150158
bind_password: "ch33kym0nk3y"
159+
```
151160

152-
With this configuration the user can log in with either ``main\someuser``,
153-
``main.example.com\someuser``, ``someuser/main.example.com`` or ``someuser``.
161+
With this configuration the user can log in with either `main\someuser`,
162+
`main.example.com\someuser`, `someuser/main.example.com` or `someuser`.
154163

155-
Users of other domains in the ``example.com`` forest can log in with ``domain\login``
156-
or ``login/domain``.
164+
Users of other domains in the `example.com` forest can log in with `domain\login`
165+
or `login/domain`.
157166

158-
Please note that ``userPrincipalName`` or a similar-looking LDAP attribute in the format
159-
``login@domain`` must be used when the ``active_directory`` option is enabled.
167+
Please note that `userPrincipalName` or a similar-looking LDAP attribute in the format
168+
`login@domain` must be used when the `active_directory` option is enabled.
160169

161-
Troubleshooting and Debugging
162-
-----------------------------
170+
## Troubleshooting and Debugging
163171

164-
``matrix-synapse-ldap3`` logging is included in the Synapse homeserver log
165-
(typically ``homeserver.log``). The LDAP plugin log level can be increased to
166-
``DEBUG`` for troubleshooting and debugging by making the following modifications
172+
`matrix-synapse-ldap3` logging is included in the Synapse homeserver log
173+
(typically `homeserver.log`). The LDAP plugin log level can be increased to
174+
`DEBUG` for troubleshooting and debugging by making the following modifications
167175
to your Synapse server's logging configuration file:
168176

169177
- Set the value for `handlers.file.level` to `DEBUG`:
170178

171-
.. code:: yaml
172-
179+
```yaml
173180
handlers:
174181
file:
175182
# [...]
176183
level: DEBUG
184+
```
177185

178186
- Add the following to the `loggers` section:
179187

180-
.. code:: yaml
181-
188+
```yaml
182189
loggers:
183190
# [...]
184191
ldap3:
185192
level: DEBUG
186193
ldap_auth_provider:
187194
level: DEBUG
195+
```
188196

189197
Finally, restart your Synapse server for the changes to take effect:
190198

191-
.. code:: sh
192-
193-
synctl restart
199+
```shell
200+
synctl restart
201+
```

0 commit comments

Comments
 (0)