add DiscoveryResponse endpoint to metadata (fixes #10197)
This commit is contained in:
parent
7a5223d050
commit
eb89a86ef3
|
@ -15,6 +15,12 @@
|
||||||
</ds:KeyInfo>
|
</ds:KeyInfo>
|
||||||
</KeyDescriptor>
|
</KeyDescriptor>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
<Extensions>
|
||||||
|
<idpdisc:DiscoveryResponse index="1"
|
||||||
|
xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"
|
||||||
|
Binding="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"
|
||||||
|
Location="{{ discovery_endpoint_url }}"/>
|
||||||
|
</Extensions>
|
||||||
<SingleLogoutService
|
<SingleLogoutService
|
||||||
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
|
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
|
||||||
Location="{{ logout_url }}" />
|
Location="{{ logout_url }}" />
|
||||||
|
|
|
@ -36,6 +36,7 @@ def create_metadata(request):
|
||||||
'default_assertion_consumer_binding': app_settings.DEFAULT_ASSERTION_CONSUMER_BINDING,
|
'default_assertion_consumer_binding': app_settings.DEFAULT_ASSERTION_CONSUMER_BINDING,
|
||||||
'organization': app_settings.ORGANIZATION,
|
'organization': app_settings.ORGANIZATION,
|
||||||
'contact_persons': app_settings.CONTACT_PERSONS,
|
'contact_persons': app_settings.CONTACT_PERSONS,
|
||||||
|
'discovery_endpoint_url': request.build_absolute_uri(reverse('mellon_login')),
|
||||||
})
|
})
|
||||||
settings._MELLON_METADATA_CACHE = cache
|
settings._MELLON_METADATA_CACHE = cache
|
||||||
return settings._MELLON_METADATA_CACHE[entity_id]
|
return settings._MELLON_METADATA_CACHE[entity_id]
|
||||||
|
|
|
@ -131,6 +131,7 @@ def test_create_metadata(rf, private_settings, caplog):
|
||||||
ns = {
|
ns = {
|
||||||
'sm': 'urn:oasis:names:tc:SAML:2.0:metadata',
|
'sm': 'urn:oasis:names:tc:SAML:2.0:metadata',
|
||||||
'ds': 'http://www.w3.org/2000/09/xmldsig#',
|
'ds': 'http://www.w3.org/2000/09/xmldsig#',
|
||||||
|
'idpdisc': 'urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol',
|
||||||
}
|
}
|
||||||
private_settings.MELLON_PUBLIC_KEYS = ['xxx', '/yyy']
|
private_settings.MELLON_PUBLIC_KEYS = ['xxx', '/yyy']
|
||||||
private_settings.MELLON_NAME_ID_FORMATS = [lasso.SAML2_NAME_IDENTIFIER_FORMAT_UNSPECIFIED]
|
private_settings.MELLON_NAME_ID_FORMATS = [lasso.SAML2_NAME_IDENTIFIER_FORMAT_UNSPECIFIED]
|
||||||
|
@ -143,7 +144,9 @@ def test_create_metadata(rf, private_settings, caplog):
|
||||||
('/sm:EntityDescriptor[@entityID="http://testserver/metadata/"]', 1,
|
('/sm:EntityDescriptor[@entityID="http://testserver/metadata/"]', 1,
|
||||||
('/*', 1),
|
('/*', 1),
|
||||||
('/sm:SPSSODescriptor', 1,
|
('/sm:SPSSODescriptor', 1,
|
||||||
('/*', 6),
|
('/*', 7),
|
||||||
|
('/sm:Extensions', 1,
|
||||||
|
('/idpdisc:DiscoveryResponse', 1)),
|
||||||
('/sm:NameIDFormat', 1),
|
('/sm:NameIDFormat', 1),
|
||||||
('/sm:SingleLogoutService', 1),
|
('/sm:SingleLogoutService', 1),
|
||||||
('/sm:AssertionConsumerService[@isDefault=\'true\'][@Binding=\'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact\']', 1),
|
('/sm:AssertionConsumerService[@isDefault=\'true\'][@Binding=\'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact\']', 1),
|
||||||
|
|
Loading…
Reference in New Issue