Assertion consumer service binding is POST if request is a HTTP-Redirect
This commit is contained in:
parent
99b3b46d16
commit
5cd93d7aae
|
@ -24,7 +24,7 @@ import shelve
|
||||||
import sys
|
import sys
|
||||||
import memcache
|
import memcache
|
||||||
|
|
||||||
from saml2 import saml
|
from saml2 import saml, BINDING_HTTP_POST
|
||||||
from saml2 import class_name
|
from saml2 import class_name
|
||||||
from saml2 import soap
|
from saml2 import soap
|
||||||
from saml2 import BINDING_HTTP_REDIRECT
|
from saml2 import BINDING_HTTP_REDIRECT
|
||||||
|
@ -342,13 +342,18 @@ class Server(object):
|
||||||
|
|
||||||
sp_entity_id = authn_request.message.issuer.text
|
sp_entity_id = authn_request.message.issuer.text
|
||||||
# try to find return address in metadata
|
# try to find return address in metadata
|
||||||
try:
|
# What's the binding ? ProtocolBinding
|
||||||
# What's the binding ? ProtocolBinding
|
if authn_request.message.protocol_binding == BINDING_HTTP_REDIRECT:
|
||||||
|
_binding = BINDING_HTTP_POST
|
||||||
|
else:
|
||||||
_binding = authn_request.message.protocol_binding
|
_binding = authn_request.message.protocol_binding
|
||||||
|
|
||||||
|
try:
|
||||||
consumer_url = self.metadata.assertion_consumer_service(sp_entity_id,
|
consumer_url = self.metadata.assertion_consumer_service(sp_entity_id,
|
||||||
binding=_binding)[0]
|
binding=_binding)[0]
|
||||||
except (KeyError, IndexError):
|
except (KeyError, IndexError):
|
||||||
_log_info("Failed to find consumer URL for %s" % sp_entity_id)
|
_log_info("Failed to find consumer URL for %s" % sp_entity_id)
|
||||||
|
_log_info("Binding: %s" % _binding)
|
||||||
_log_info("entities: %s" % self.metadata.entity.keys())
|
_log_info("entities: %s" % self.metadata.entity.keys())
|
||||||
raise UnknownPrincipal(sp_entity_id)
|
raise UnknownPrincipal(sp_entity_id)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue