From e543fddc2aac8cc8fa530a09f666a2672739e44c Mon Sep 17 00:00:00 2001 From: sandhose Date: Tue, 9 Jul 2024 09:53:39 +0000 Subject: deploy: abb1384502f66ddde3fd0db844c4e719b01023ff --- v1.111/development/saml.html | 242 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 v1.111/development/saml.html (limited to 'v1.111/development/saml.html') diff --git a/v1.111/development/saml.html b/v1.111/development/saml.html new file mode 100644 index 0000000000..fe9405c747 --- /dev/null +++ b/v1.111/development/saml.html @@ -0,0 +1,242 @@ + + + + + + SAML - Synapse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+ +
+ +
+ +

How to test SAML as a developer without a server

+

https://fujifish.github.io/samling/samling.html (https://github.com/fujifish/samling) is a great resource for being able to tinker with the +SAML options within Synapse without needing to deploy and configure a complicated software stack.

+

To make Synapse (and therefore Element) use it:

+
    +
  1. Use the samling.html URL above or deploy your own and visit the IdP Metadata tab.
  2. +
  3. Copy the XML to your clipboard.
  4. +
  5. On your Synapse server, create a new file samling.xml next to your homeserver.yaml with +the XML from step 2 as the contents.
  6. +
  7. Edit your homeserver.yaml to include: +
    saml2_config:
    +  sp_config:
    +    allow_unknown_attributes: true  # Works around a bug with AVA Hashes: https://github.com/IdentityPython/pysaml2/issues/388
    +    metadata:
    +      local: ["samling.xml"]
    +
    +
  8. +
  9. Ensure that your homeserver.yaml has a setting for public_baseurl: +
    public_baseurl: http://localhost:8080/
    +
    +
  10. +
  11. Run apt-get install xmlsec1 and pip install --upgrade --force 'pysaml2>=4.5.0' to ensure +the dependencies are installed and ready to go.
  12. +
  13. Restart Synapse.
  14. +
+

Then in Element:

+
    +
  1. Visit the login page and point Element towards your homeserver using the public_baseurl above.
  2. +
  3. Click the Single Sign-On button.
  4. +
  5. On the samling page, enter a Name Identifier and add a SAML Attribute for uid=your_localpart. +The response must also be signed.
  6. +
  7. Click "Next".
  8. +
  9. Click "Post Response" (change nothing).
  10. +
  11. You should be logged in.
  12. +
+

If you try and repeat this process, you may be automatically logged in using the information you +gave previously. To fix this, open your developer console (F12 or Ctrl+Shift+I) while on the +samling page and clear the site data. In Chrome, this will be a button on the Application tab.

+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + + -- cgit 1.4.1