2021-10-18 19:09:26 +00:00
---
title: Matrix Synapse
---
2022-06-15 19:31:34 +00:00
< span class = "badge badge--secondary" > Support level: Community< / span >
2021-10-18 19:09:26 +00:00
## What is Matrix Synapse
2023-07-31 10:16:58 +00:00
> Matrix is an open source project that publishes the Matrix open standard for secure, decentralised, real-time communication, and its Apache licensed reference implementations.
>
> -- https://matrix.org/
2021-10-18 19:09:26 +00:00
## Preparation
The following placeholders will be used:
2022-05-09 19:22:41 +00:00
- `matrix.company` is the FQDN of the Matrix install.
- `authentik.company` is the FQDN of the authentik install.
2021-10-18 19:09:26 +00:00
Create an application in authentik. Create an OAuth2/OpenID provider with the following parameters:
2022-05-09 19:22:41 +00:00
- Client Type: `Confidential`
- Scopes: OpenID, Email and Profile
- Signing Key: Select any available key
- Redirect URIs: `https://matrix.company/_synapse/client/oidc/callback`
2021-10-18 19:09:26 +00:00
Note the Client ID and Client Secret values. Create an application, using the provider you've created above. Note the slug of the application you've created.
## Matrix
Add the following block to your Matrix config
2022-01-10 19:19:56 +00:00
:::info
For more info, see https://matrix-org.github.io/synapse/latest/openid.html?highlight=authentik#authentik
:::
2021-10-18 19:09:26 +00:00
```yaml
oidc_providers:
2022-05-09 19:22:41 +00:00
- idp_id: authentik
idp_name: authentik
discover: true
issuer: "https://authentik.company/application/o/app-slug/"
client_id: "*client id*"
client_secret: "*client secret*"
scopes:
- "openid"
- "profile"
- "email"
user_mapping_provider:
config:
localpart_template: "{{ user.preferred_username }}"
display_name_template: "{{ user.name|capitalize }}"
2021-10-18 19:09:26 +00:00
```