add generic handler to overload for slo and nidm
This commit is contained in:
parent
ae5bf74101
commit
e31666ee90
|
@ -65,40 +65,46 @@ class LassoSPKitEndpoint extends LassoSPKitUrlDispatch {
|
|||
}
|
||||
/** Profiles initiés par l'IdP */
|
||||
function sloBrws() {
|
||||
$ret = 0;
|
||||
try {
|
||||
$profile = $this->getProfileObject();
|
||||
$http_method = $this->limitMethodBrws($this->identifyHttpMethod());
|
||||
$query_string = $this->getQueryString($http_method);
|
||||
return $profile->processRequestSLO($http_method, $query_string);
|
||||
$ret = $profile->processRequestSLO($http_method, $query_string);
|
||||
} catch (LassoError $e) {
|
||||
return $e->getCode();
|
||||
$ret = $e->getCode();
|
||||
} catch (Exception $e) {
|
||||
return -1;
|
||||
$ret = -1;
|
||||
}
|
||||
return $this->handleSlo($ret);
|
||||
}
|
||||
function sloSoap() {
|
||||
$ret = 0;
|
||||
try {
|
||||
$profile = $this->getProfileObject();
|
||||
return $profile->processSOAPRequestSLO();
|
||||
$ret = $profile->processSOAPRequestSLO();
|
||||
} catch (LassoError $e) {
|
||||
lassospkit_debuglog('Critical error: ' . $e);
|
||||
return $e->getCode();
|
||||
$ret = $e->getCode();
|
||||
} catch (Exception $e) {
|
||||
return -1;
|
||||
$ret = -1;
|
||||
}
|
||||
return $this->handleSlo($ret);
|
||||
}
|
||||
/** Profiles initiés par le SP */
|
||||
function sloReturn() {
|
||||
$ret = 0;
|
||||
try {
|
||||
$profile = $this->getProfileObject();
|
||||
$http_method = $this->limitMethodBrws($this->identifyHttpMethod());
|
||||
$query_string = $this->getQueryString($http_method);
|
||||
return $profile->processResponseSLO($http_method, $query_string);
|
||||
$ret = $profile->processResponseSLO($http_method, $query_string);
|
||||
} catch (LassoError $e) {
|
||||
return $e->getCode();
|
||||
$ret = $e->getCode();
|
||||
} catch (Exception $e) {
|
||||
return -1;
|
||||
$ret = -1;
|
||||
}
|
||||
return $this->handlSloReturn($ret);
|
||||
}
|
||||
function identifyHttpMethod() {
|
||||
if (isset($_POST) && ( isset($_POST['SAMLResponse']) || isset($_POST['SAMLRequest']))) {
|
||||
|
@ -138,5 +144,11 @@ class LassoSPKitEndpoint extends LassoSPKitUrlDispatch {
|
|||
}
|
||||
return LASSO_HTTP_METHOD_NONE;
|
||||
}
|
||||
function handleSlo($ret) {
|
||||
return $ret;
|
||||
}
|
||||
function handleSloReturn($ret) {
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,18 +39,23 @@ class LassoSPKitSaml2Endpoint extends LassoSPKitEndpoint {
|
|||
// TODO
|
||||
}
|
||||
function nameIdManagementSoap() {
|
||||
$ret = 0;
|
||||
try {
|
||||
$profile = $this->getProfileObject();
|
||||
return $profile->processSOAPRequestNameIdManagement();
|
||||
$ret = $profile->processSOAPRequestNameIdManagement();
|
||||
} catch (LassoError $e) {
|
||||
lassospkit_debuglog('Critical error: ' . $e);
|
||||
return $e->getCode();
|
||||
$ret = $e->getCode();
|
||||
} catch (Exception $e) {
|
||||
lassospkit_debuglog('Unkown exception error: ' . $e);
|
||||
return -1;
|
||||
$ret = -1;
|
||||
}
|
||||
return $this->handleNameIdManagement($ret);
|
||||
}
|
||||
function nameIdManagementReturn() {
|
||||
// TODO
|
||||
}
|
||||
function handleNameIdManagement($ret) {
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue