本文整理汇总了PHP中SimpleSAML_Auth_State::loadExceptionState方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSAML_Auth_State::loadExceptionState方法的具体用法?PHP SimpleSAML_Auth_State::loadExceptionState怎么用?PHP SimpleSAML_Auth_State::loadExceptionState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleSAML_Auth_State
的用法示例。
在下文中一共展示了SimpleSAML_Auth_State::loadExceptionState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: realMeErrorHandler
/**
* Process the error/Exception returned from SimpleSaml and return an appropriate error to the user.
*
* @return SS_HTTPResponse
*/
private function realMeErrorHandler()
{
// Error handling, to prevent infinite login loops if there was an internal error with SimpleSAMLphp
if ($exceptionId = $this->owner->getRequest()->getVar('SimpleSAML_Auth_State_exceptionId')) {
if (is_string($exceptionId) && strlen($exceptionId) > 1) {
$authState = SimpleSAML_Auth_State::loadExceptionState($exceptionId);
if (true === array_key_exists('SimpleSAML_Auth_State.exceptionData', $authState) && $authState['SimpleSAML_Auth_State.exceptionData'] instanceof sspmod_saml_Error) {
$exception = $authState['SimpleSAML_Auth_State.exceptionData'];
$message = $this->getErrorMessage($exception);
SS_Log::log(sprintf('Error while validating RealMe authentication details: %s', $message), SS_Log::ERR);
return Security::permissionFailure($this->owner, $message);
}
}
}
SS_Log::log('Unknown error while attempting to parse RealMe authentication', SS_Log::ERR);
return Security::permissionFailure($this->owner, _t('RealMeSecurityExtension.GENERAL_ERROR', '', array('errorMsg' => 'Unknown')));
}
示例2: catch
*
*/
$requestcache['NeedAuthentication'] = TRUE;
}
$requestcache['IsPassive'] = $isPassive;
$requestcache['ForceAuthn'] = $forceAuthn;
SimpleSAML_Logger::info('SAML2.0 - IdP.SSOService: Incomming Authentication request: ' . $issuer . ' id ' . $requestid);
} catch (Exception $exception) {
SimpleSAML_Utilities::fatalError($session->getTrackID(), 'PROCESSAUTHNREQUEST', $exception);
}
} elseif (isset($_REQUEST[SimpleSAML_Auth_State::EXCEPTION_PARAM])) {
/*
* We have received an exception. It can either be from the authentication module,
* or from the authentication processing filters.
*/
$state = SimpleSAML_Auth_State::loadExceptionState();
if (array_key_exists('core:saml20-idp:requestcache', $state)) {
/* This was from a processing chain. */
$requestcache = $state['core:saml20-idp:requestcache'];
} elseif (array_key_exists('RequestID', $_REQUEST)) {
/* This was from an authentication module. */
$authId = $_REQUEST['RequestID'];
$requestcache = $session->getAuthnRequest('saml2', $authId);
if (!$requestcache) {
throw new Exception('Could not retrieve saved request while handling exceptions. RequestID=' . var_export($authId, TRUE));
}
} else {
/* We have no idea where this comes from. We have received a bad request. */
throw new Exception('Bad request to exception handing code.');
}
assert('array_key_exists(SimpleSAML_Auth_State::EXCEPTION_DATA, $state)');