Skip to content

Commit 4db34ca

Browse files
authored
SAML: Add example for Authentik (#246)
* Update SAML_CERTS_DIR in snippet * SAML: Add example for Authentik --------- Co-authored-by: Simon Hammes <simonhammes@users.noreply.github.com>
1 parent 3f8f8f8 commit 4db34ca

File tree

1 file changed

+64
-1
lines changed
  • docs/configuration/authentication

1 file changed

+64
-1
lines changed

docs/configuration/authentication/saml.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ SAML_ATTRIBUTE_MAP = {
113113
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress': 'contact_email',
114114
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name': 'name',
115115
}
116-
SAML_CERTS_DIR = '/opt/seatable/seahub-data/certs'
116+
SAML_CERTS_DIR = '/shared/certs'
117117
```
118118

119119
!!! Details about the SAML_ATTRIBUTE_MAP
@@ -256,3 +256,66 @@ SAML_CERTS_DIR = '/shared/certs'
256256
Replace the value of the SAML_REMOTE_METADATA_URL variable with the URL obtained in step 2.
257257

258258
Restart the SeaTable service for the changes to take effect.
259+
260+
## Configuration Authentik
261+
262+
Click on 'Applications' in the navigation on the left. Then choose 'Applications' in the drop-down menu to see a list of the apps that have already been configured in your account.
263+
264+
**Step 1 - Application**
265+
266+
Enter a name and a slug and click on **Next**.
267+
268+
**Step 2 - Choose A Provider**
269+
270+
Select **SAML Provider**.
271+
272+
**Step 3 - Configure Provider**
273+
274+
Select `default-provider-authorization-explicit-consent (Authorize Application)`.
275+
276+
Under **Protocol settings**, set the **ACS URL** to `https://${SEATABLE_SERVER_HOSTNAME}/saml/acs` and set the **Service Provider Binding** to **Post**.
277+
278+
Under **Advanced protocol settings**, select **authentik Self-Signed Certificate** as the **Signing Certificate** and enable the **Sign assertions** toggle.
279+
280+
**Step 4 - Configure Bindings**
281+
282+
Click on **Next**.
283+
284+
**Step 5 - Review and Submit Application**
285+
286+
Click on **Submit**
287+
288+
---
289+
290+
Next, select **Applications -> Providers** in the left sidebar and select the newly created provider.
291+
You should now see a **Copy download URL** to get the metadata URL and a **Download** button to download the signing certificate button.
292+
293+
Since authentik's download URL returns a 302 redirect, you must run the following command to figure out the _true_ download URL:
294+
295+
```bash
296+
curl ${AUTHENTIK_DOWNLOAD_URL} -I
297+
```
298+
299+
This will display the _true_ download URL in the location header. Take a note of this URL.
300+
301+
You should also download the signing certificate and store it under `/opt/seatable-server/certs`.
302+
303+
You should now run the `openssl` command described in [here]() to create `sp.crt` and `sp.key` inside `/opt/seatable-server/certs`.
304+
305+
A basic SAML configuration in `dtable_web_settings.py` for authentik looks like this:
306+
307+
```python
308+
ENABLE_SAML = True
309+
SAML_PROVIDER_IDENTIFIER = 'authentik'
310+
SAML_REMOTE_METADATA_URL = 'YOUR_METADATA_URL'
311+
SAML_ATTRIBUTE_MAP = {
312+
'http://schemas.goauthentik.io/2021/02/saml/uid': 'uid',
313+
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress': 'contact_email',
314+
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name': 'name',
315+
}
316+
SAML_CERTS_DIR = '/shared/certs'
317+
```
318+
319+
Replace the value of the SAML_REMOTE_METADATA_URL variable with the URL you obtained via the `curl` command.
320+
321+
Restart the SeaTable service for the changes to take effect.

0 commit comments

Comments
 (0)