add an implementation of FTNotification

This commit is contained in:
<bdauvergne@entrouvert.com> 1210147537 +0200 0001-01-01 00:00:00 +00:00
parent 8356925f73
commit b92945e62c
1 changed files with 40 additions and 0 deletions

View File

@ -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;
}
}