element-hq / element-hq/synapse

Support signing SAML requests

Open
#11,130 0 comments 0 reactions 0 assignees View on GitHub
P4 T-Enhancement
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#11130](https://github.com/matrix-org/synapse/issues/11130).

---

Currently it is not possible to use SAML SSO with an IdP that requires signed requests.

However, the change is trivial:

```patch
--- saml.py.old 2021-10-19 13:47:01.000000000 +0200
+++ saml.py 2021-10-20 08:42:26.897442375 +0200
@@ -112,7 +112,8 @@
client_redirect_url = b"unused"

reqid, info = self._saml_client.prepare_for_authenticate(
- entityid=self._saml_idp_entityid, relay_state=client_redirect_url
+ entityid=self._saml_idp_entityid, relay_state=client_redirect_url,
+ sign=True
)

# Since SAML sessions timeout it is useful to log when they were created.
```

This True value should probably come from the config.

Contributor guide

Open the contributing guide

Research direction

Start in saml.py at the _saml_client.prepare_for_authenticate call shown in the issue, then trace how SAML settings are loaded. Make request signing configurable rather than always enabled, and verify that an IdP requiring signed requests can complete SAML SSO without breaking the existing flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authentication
Issue type
Feature
Difficulty
2/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.