30 assert(is_string($urn));
33 case Constants::BINDING_HTTP_POST:
35 case Constants::BINDING_HTTP_REDIRECT:
37 case Constants::BINDING_HTTP_ARTIFACT:
39 case Constants::BINDING_HOK_SSO:
44 case Constants::BINDING_PAOS:
47 throw new \Exception(
'Unsupported binding: ' . var_export($urn,
true));
64 switch (
$_SERVER[
'REQUEST_METHOD']) {
66 if (array_key_exists(
'SAMLRequest',
$_GET) || array_key_exists(
'SAMLResponse',
$_GET)) {
68 } elseif (array_key_exists(
'SAMLart',
$_GET)) {
74 if (isset(
$_SERVER[
'CONTENT_TYPE'])) {
81 if (array_key_exists(
'SAMLRequest',
$_POST) || array_key_exists(
'SAMLResponse',
$_POST)) {
83 } elseif (array_key_exists(
'SAMLart',
$_POST)) {
91 $logger = Utils::getContainer()->getLogger();
92 $logger->warning(
'Unable to find the SAML 2 binding used for this request.');
93 $logger->warning(
'Request method: ' . var_export(
$_SERVER[
'REQUEST_METHOD'],
true));
95 $logger->warning(
"GET parameters: '" . implode(
"', '", array_map(
'addslashes', array_keys(
$_GET))) .
"'");
98 $logger->warning(
"POST parameters: '" . implode(
"', '", array_map(
'addslashes', array_keys(
$_POST))) .
"'");
100 if (isset(
$_SERVER[
'CONTENT_TYPE'])) {
101 $logger->warning(
'Content-Type: ' . var_export(
$_SERVER[
'CONTENT_TYPE'],
true));
104 throw new \Exception(
'Unable to find the current binding.');
149 abstract public function receive();
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
static getBinding($urn)
Retrieve a binding with the given URN.
static getCurrentBinding()
Guess the current binding.
getDestination()
Retrieve the destination of a message.
$destination
The destination of messages.
Base class for all SAML 2 messages.
catch(Exception $e) $message
setDestination($destination)
Override the destination of a message.
if($path[strlen($path) - 1]==='/') if(is_dir($path)) if(!file_exists($path)) if(preg_match('#\.php$#D', $path)) $contentType