Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

SAML: add <mdui:UIInfo> element examples #8718

Merged
merged 8 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8718.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add some mdui:UIInfo element examples for saml2_config in homeserver.yaml.
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
18 changes: 18 additions & 0 deletions docs/sample_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,24 @@ saml2_config:
#description: ["My awesome SP", "en"]
#name: ["Test SP", "en"]

#ui_info:
# display_name:
# - lang: en
# text: "Display Name is the descriptive name of your service."
# description:
# - lang: en
# text: "Description should be a short paragraph explaining the purpose of the service."
# information_url:
# - lang: en
# text: "https://example.com/terms-of-service"
# privacy_statement_url:
# - lang: en
# text: "https://example.com/privacy-policy"
# logo:
# text: "https://example.com/logo.svg"
# width: "200"
# height: "80"

#organization:
# name: Example com
# display_name:
Expand Down
18 changes: 18 additions & 0 deletions synapse/config/saml2_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,24 @@ def generate_config_section(self, config_dir_path, server_name, **kwargs):
#description: ["My awesome SP", "en"]
#name: ["Test SP", "en"]

#ui_info:
# display_name:
# - lang: en
# text: "Display Name is the descriptive name of your service."
# description:
# - lang: en
# text: "Description should be a short paragraph explaining the purpose of the service."
# information_url:
# - lang: en
# text: "https://example.com/terms-of-service"
# privacy_statement_url:
# - lang: en
# text: "https://example.com/privacy-policy"
# logo:
# text: "https://example.com/logo.svg"
# width: "200"
# height: "80"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://github.com/IdentityPython/pysaml2/blob/59d6fa5df06989525d2d7e5b8762bbfa3485ab42/src/saml2/metadata.py#L268-L276 it looks as though logo can also be a list of dicts, which looks more flexible. Any reason that's not show in the example?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anoadragon453 no reasons, feel free to modify it. This is basically the config I use in my SAML config.

Copy link
Contributor Author

@localguru localguru Nov 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anoadragon453 like for all elements multiple languages are possible like

ui_info:
     display_name:
       - lang: en
         text: "Display Name is the descriptive name of your service."
       - lang: de
         text: "Display Name ist der beschreibende Name Ihres Dienstes"

So I think for logo it has to look like this

           logo:
              - lang: en
                text: "https://example.com/logo_en.svg"
                width: "200"
                height: "80"
              - lang: de
                text: "https://example.com/logo_de.svg"
                width: "200"
                height: "80"

But never seen multiple logos in any config. I think we have to test that.

Copy link
Contributor Author

@localguru localguru Nov 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anoadragon453 Andrew, I checked list of dicts for logo element and it is generating valid metadata /_matrix/saml2/metadata.xml:

saml2_config:

ui_info:
           [...]
           logo:
              - lang: en
                text: "https://example.com/logo_en.svg"
                width: "200"
                height: "80"
              - lang: de
                text: "https://example.com/logo_de.svg"
                width: "200"
                height: "80"

/saml2/metadata.xml:

<ns1:Logo height="86" width="200" xml:lang="de">
https://example.com/logo_de.svg
</ns1:Logo>
<ns1:Logo height="86" width="200" xml:lang="en">
https://example.com/logo_en.svg
</ns1:Logo>

The central Shibboleth IdP at my university also evaluates the language for logos. If I switch the browser between DE and EN, the corresponding logo is also displayed on the registration form of the IdP.

Furthermore I have added the keywords element.

So I mean, this is now a useful example configuration.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to hear, thank you for testing!


#organization:
# name: Example com
# display_name:
Expand Down