From b92945e62ca76e880607776d30b308e025358b8f Mon Sep 17 00:00:00 2001 From: Date: Wed, 7 May 2008 10:05:37 +0200 Subject: [PATCH] add an implementation of FTNotification --- include/lassospkit_liberty.inc.php | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/include/lassospkit_liberty.inc.php b/include/lassospkit_liberty.inc.php index 9e8bc32..ec341e7 100644 --- a/include/lassospkit_liberty.inc.php +++ b/include/lassospkit_liberty.inc.php @@ -14,4 +14,44 @@ class LassoSPKitLiberty extends LassoSPKitSAMLCommon { $request = $login->request; $request->NameIDPolicy = $blob; } + public function initiateFTNotification($method = LASSO_HTTP_METHOD_SOAP, $remoteID = null) { + $code = null; + $response = null; + $defederation = new LassoDefederation($this->server); + $retFF = $this->findFederation($defederation); + if ($retFF) { + return $retFF; + } + $retIN = $defederation->initNotification($remoteID, $method); + $retBN = $defederation->buildNotificationMsg(); + if ($retIN || $retBN) { + lassospkit_errlog("initiateFTNotification, retIN: $retIN retBN: $retBN"); + } + switch ($method) { + case LASSO_HTTP_METHOD_REDIRECT: + $this->keepProfile($defederation); + $this->finishRedirectRequest($defederation); + break; + case LASSO_HTTP_METHOD_SOAP: + $this->finishSOAPRequest($defederation, $response, $code); + break; + case LASSO_HTTP_METHOD_ARTIFACT_GET: + case LASSO_HTTP_METHOD_ARTIFACT_POST: + case LASSO_HTTP_METHOD_POST: + default: + LassoSPKitHelper::notImplemented(); + } + LassoSPKitSamlCommon::initiateFTNotification($method, $remoteID); + if ($retIN) { + return $retIN; + } + if ($retBN) { + return $retBN; + } + if ($code != "200") { + lassospkit_errlog('initiateFTNotification, IdP returned non-200 HTTP result code: ' . $code); + return -1; + } + return 0; + } }