Exemplo n.º 1
0
 public function decodeResponse($post)
 {
     if (!isset($post["SAMLResponse"])) {
         throw new Exception('Could not get SAMLResponse from Browser/POST. May be there is some redirection related problem on your server? In example apache redirecting the POST to http to a GET on https.');
     }
     $rawResponse = $post["SAMLResponse"];
     $relaystate = $post["RelayState"];
     $samlResponseXML = base64_decode($rawResponse);
     SimpleSAML_Utilities::validateXMLDocument($samlResponseXML, 'saml20');
     //error_log("Response is: " . $samlResponseXML);
     $samlResponse = new SimpleSAML_XML_SAML20_AuthnResponse($this->configuration, $this->metadata);
     $samlResponse->setXML($samlResponseXML);
     if (isset($relaystate)) {
         $samlResponse->setRelayState($relaystate);
     }
     #echo("Authn response = " . $samlResponse );
     return $samlResponse;
 }