app_settings,views: make the default assertion consumer binding customizable, and restore POST as the default

And restore default to POST.

fixes #7406
This commit is contained in:
Benjamin Dauvergne 2015-05-29 11:00:10 +02:00
parent c9b4663033
commit d5b8ec81a9
3 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,7 @@ class AppSettings(object):
'CREATE_GROUP': True,
'ERROR_URL': None,
'ERROR_REDIRECT_AFTER_TIMEOUT': 120,
'DEFAULT_ASSERTION_CONSUMER_BINDING': 'post', # or artifact
}
@property

View File

@ -25,11 +25,16 @@
{% endfor %}
<AssertionConsumerService
index="0"
{% if default_assertion_consumer_binding = 'artifact' %}
isDefault="true"
{% endif %}
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
Location="{{ login_url }}" />
<AssertionConsumerService
index="1"
{% if default_assertion_consumer_binding = 'post' %}
isDefault="true"
{% endif %}
Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
Location="{{ login_url }}" />
</SPSSODescriptor>

View File

@ -32,6 +32,7 @@ def create_metadata(request):
'logout_url': request.build_absolute_uri(logout_url),
'public_keys': public_keys,
'name_id_formats': name_id_formats,
'default_assertion_consumer_binding': app_settings.DEFAULT_ASSERTION_CONSUMER_BINDING,
})
return METADATA[entity_id]