36        $store = SimpleSAML_Store::getInstance();
 
   38            throw new \Exception(
'Unable to send artifact without a datastore configured.');
 
   42        $artifact = base64_encode(
"\x00\x04\x00\x00" . sha1(
$message->getIssuer(), 
true) . $generatedId) ;
 
   43        $artifactData = 
$message->toUnsignedXML();
 
   44        $artifactDataString = $artifactData->ownerDocument->saveXML($artifactData);
 
   80    public function receive()
 
   82        if (array_key_exists(
'SAMLart', $_REQUEST)) {
 
   83            $artifact = base64_decode($_REQUEST[
'SAMLart']);
 
   84            $endpointIndex =  bin2hex(substr(
$artifact, 2, 2));
 
   87            throw new \Exception(
'Missing SAMLart parameter.');
 
   95            throw new \Exception(
'No metadata found for remote provider with SHA1 ID: ' . var_export(
$sourceId, 
true));
 
   99        foreach (
$idpMetadata->getEndpoints(
'ArtifactResolutionService') as $ep) {
 
  100            if ($ep[
'index'] ===  hexdec($endpointIndex)) {
 
  107            throw new \Exception(
'No ArtifactResolutionService with the correct index.');
 
  110        Utils::getContainer()->getLogger()->debug(
"ArtifactResolutionService endpoint being used is := " . 
$endpoint[
'Location']);
 
  113        $ar = 
new ArtifactResolve();
 
  117        $ar->setIssuer($this->spMetadata->getString(
'entityid'));
 
  118        $ar->setArtifact($_REQUEST[
'SAMLart']);
 
  119        $ar->setDestination(
$endpoint[
'Location']);
 
  124        $soap = 
new SOAPClient();
 
  131            throw new \Exception(
'Received error from ArtifactResolutionService.');
 
  141        $samlResponse = Message::fromXML(
$xml);
 
  142        $samlResponse->addValidator(array(get_class($this), 
'validateSignature'), 
$artifactResponse);
 
  144        if (isset($_REQUEST[
'RelayState'])) {
 
  145            $samlResponse->setRelayState($_REQUEST[
'RelayState']);
 
  148        return $samlResponse;
 
  156        $this->spMetadata = $sp;
 
if(!array_key_exists(sspmod_authfacebook_Auth_Source_Facebook::AUTHID, $state)) $sourceId
An exception for terminatinating execution or to throw for unit testing.
getRedirectURL(Message $message)
Create the redirect URL for a message.
static validateSignature(ArtifactResponse $message, XMLSecurityKey $key)
A validator which returns true if the ArtifactResponse was signed with the given key.
setSPMetadata(SimpleSAML_Configuration $sp)
send(Message $message)
Send a SAML 2 message using the HTTP-Redirect binding.
Base class for all SAML 2 messages.
static stringToHex($bytes)
static addURLparameter($url, $parameters)
static generateRandomBytes($length)
static addSign(SimpleSAML_Configuration $srcMetadata, SimpleSAML_Configuration $dstMetadata, \SAML2\SignedElement $element)
Add signature key and sender certificate to an element (Message or Assertion).
if(! $oauthconfig->getBoolean('getUserInfo.enable', FALSE)) $store
catch(Exception $e) $message