當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SimpleSAML_Auth_State::loadExceptionState方法代碼示例

本文整理匯總了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')));
 }
開發者ID:helpfulrobot,項目名稱:silverstripe-realme,代碼行數:22,代碼來源:RealMeSecurityExtension.php

示例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)');
開發者ID:hukumonline,項目名稱:yii,代碼行數:31,代碼來源:SSOService.php


注:本文中的SimpleSAML_Auth_State::loadExceptionState方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。