-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
SAML: last RequestedAttribute is always set to isRequired="false" #8720
Comments
This seems odd. AFAIK we just pass that config straight through to |
Aha, it looks like the default synapse/synapse/handlers/saml_handler.py Lines 519 to 532 in 6abb1ad
So I think what is happening here is that we're creating a metadata file with We should probably do something to correctly remove duplicates between required and optional parameters before passing the config to synapse/synapse/config/saml2_config.py Lines 153 to 155 in 6abb1ad
or when we generate the metadata: synapse/synapse/rest/saml2/metadata_resource.py Lines 32 to 34 in 6abb1ad
|
My workaround is to set empty service:
sp:
required_attributes: ["uid", "displayName"]
optional_attributes: [] The result in <ns0:RequestedAttribute Name="urn:oid:0.9.2342.19200300.100.1.1" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" FriendlyName="uid" isRequired="true"/>
<ns0:RequestedAttribute Name="urn:oid:2.16.840.1.113730.3.1.241" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" FriendlyName="displayName" isRequired="true"/> Otherwise: service:
sp:
required_attributes: ["uid", "displayName"] The result in <ns0:RequestedAttribute Name="urn:oid:0.9.2342.19200300.100.1.1" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" FriendlyName="uid" isRequired="true"/>
<ns0:RequestedAttribute Name="urn:oid:2.16.840.1.113730.3.1.241" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" FriendlyName="displayName" isRequired="true"/>
<ns0:RequestedAttribute Name="urn:oid:2.16.840.1.113730.3.1.241" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" FriendlyName="displayName" isRequired="false"/>
<ns0:RequestedAttribute Name="urn:oid:1.2.840.113549.1.9.1.1" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" FriendlyName="email" isRequired="false"/> |
Description
In the SAML metadata generated under URL
/_matrix/saml2/metadata.xml
for the lastrequestedAttribut
isRequired
is always set tofalse
. IfisRequired
is evaluated by the IDP, this results in the attribute not being passed from the IDP to the SP.Steps to reproduce
saml2_config
in homeserver.yamlsaml2-attribute-maps/map.py
:/_matrix/saml2/metadata.xml
. The lastRequestedAttribute
, in this exampledisplayName
, is set toisRequired="false"
. I would expectisRequired="true"
for allrequired_attributes
.Workaround
As a workaround I have added an optional attribute in the homeserver.yaml. This means that the optional attribute is the last attribute and this one is set to false. I'm not really sure if this is a bug or if my configuration is incorrect.
generated metadata URL
/_matrix/saml2/metadata.xml
:Version information
https://packages.matrix.org/debian/ bionic main
The text was updated successfully, but these errors were encountered: