当前位置: 首页>>代码示例>>PHP>>正文


PHP SimpleSAML_Auth_ProcessingChain::processState方法代码示例

本文整理汇总了PHP中SimpleSAML_Auth_ProcessingChain::processState方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSAML_Auth_ProcessingChain::processState方法的具体用法?PHP SimpleSAML_Auth_ProcessingChain::processState怎么用?PHP SimpleSAML_Auth_ProcessingChain::processState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleSAML_Auth_ProcessingChain的用法示例。


在下文中一共展示了SimpleSAML_Auth_ProcessingChain::processState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postAuth

 /**
  * The user is authenticated.
  *
  * @param array $state  The authentication request state arrray.
  */
 public static function postAuth(array $state)
 {
     $idp = SimpleSAML_IdP::getByState($state);
     if (!$idp->isAuthenticated()) {
         throw new SimpleSAML_Error_Exception('Not authenticated.');
     }
     $state['Attributes'] = $idp->authSource->getAttributes();
     if (isset($state['SPMetadata'])) {
         $spMetadata = $state['SPMetadata'];
     } else {
         $spMetadata = array();
     }
     if (isset($state['core:SP'])) {
         $session = SimpleSAML_Session::getSessionFromRequest();
         $previousSSOTime = $session->getData('core:idp-ssotime', $state['core:IdP'] . ';' . $state['core:SP']);
         if ($previousSSOTime !== NULL) {
             $state['PreviousSSOTimestamp'] = $previousSSOTime;
         }
     }
     $idpMetadata = $idp->getConfig()->toArray();
     $pc = new SimpleSAML_Auth_ProcessingChain($idpMetadata, $spMetadata, 'idp');
     $state['ReturnCall'] = array('SimpleSAML_IdP', 'postAuthProc');
     $state['Destination'] = $spMetadata;
     $state['Source'] = $idpMetadata;
     $pc->processState($state);
     self::postAuthProc($state);
 }
开发者ID:shirlei,项目名称:simplesaml,代码行数:32,代码来源:IdP.php

示例2: handleResponse

 /**
  * Handle a response from a SSO operation.
  *
  * @param array $state  The authentication state.
  * @param string $idp  The entity id of the IdP.
  * @param array $attributes  The attributes.
  */
 public function handleResponse(array $state, $idp, array $attributes)
 {
     assert('is_string($idp)');
     assert('array_key_exists("LogoutState", $state)');
     assert('array_key_exists("saml:logout:Type", $state["LogoutState"])');
     $idpMetadata = $this->getIdpMetadata($idp);
     $spMetadataArray = $this->metadata->toArray();
     $idpMetadataArray = $idpMetadata->toArray();
     /* Save the IdP in the state array. */
     $state['saml:sp:IdP'] = $idp;
     $state['PersistentAuthData'][] = 'saml:sp:IdP';
     $authProcState = array('saml:sp:IdP' => $idp, 'saml:sp:State' => $state, 'ReturnCall' => array('sspmod_saml_Auth_Source_SP', 'onProcessingCompleted'), 'Attributes' => $attributes, 'Destination' => $spMetadataArray, 'Source' => $idpMetadataArray);
     if (isset($state['saml:sp:NameID'])) {
         $authProcState['saml:sp:NameID'] = $state['saml:sp:NameID'];
     }
     if (isset($state['saml:sp:SessionIndex'])) {
         $authProcState['saml:sp:SessionIndex'] = $state['saml:sp:SessionIndex'];
     }
     $pc = new SimpleSAML_Auth_ProcessingChain($idpMetadataArray, $spMetadataArray, 'sp');
     $pc->processState($authProcState);
     self::onProcessingCompleted($authProcState);
 }
开发者ID:simplesamlphp,项目名称:simplesamlphp,代码行数:29,代码来源:SP.php

示例3: finishLogin

    $authProcState = SimpleSAML_Auth_ProcessingChain::fetchProcessedState($authProcId);
    finishLogin($authProcState);
}
if (empty($_POST['SAMLResponse'])) {
    throw new SimpleSAML_Error_Error('ACSPARAMS', $exception);
}
try {
    $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
    $binding = new SimpleSAML_Bindings_Shib13_HTTPPost($config, $metadata);
    $authnResponse = $binding->decodeResponse($_POST);
    $authnResponse->validate();
    /* Successfully authenticated. */
    $idpmetadata = $metadata->getMetadata($authnResponse->getIssuer(), 'shib13-idp-remote');
    SimpleSAML_Logger::info('Shib1.3 - SP.AssertionConsumerService: Successful authentication to IdP ' . $idpmetadata['entityid']);
    SimpleSAML_Logger::stats('shib13-sp-SSO ' . $metadata->getMetaDataCurrentEntityID('shib13-sp-hosted') . ' ' . $idpmetadata['entityid'] . ' NA');
    $relayState = $authnResponse->getRelayState();
    if (!isset($relayState)) {
        throw new SimpleSAML_Error_Error('NORELAYSTATE');
    }
    $spmetadata = $metadata->getMetaData(NULL, 'shib13-sp-hosted');
    /* Begin module attribute processing */
    $pc = new SimpleSAML_Auth_ProcessingChain($idpmetadata, $spmetadata, 'sp');
    $authProcState = array('core:shib13-sp:NameID' => $authnResponse->getNameID(), 'core:shib13-sp:SessionIndex' => $authnResponse->getSessionIndex(), 'core:shib13-sp:TargetURL' => SimpleSAML_Utilities::checkURLAllowed($relayState), 'ReturnURL' => SimpleSAML_Utilities::selfURLNoQuery(), 'Attributes' => $authnResponse->getAttributes(), 'Destination' => $spmetadata, 'Source' => $idpmetadata);
    $pc->processState($authProcState);
    /* Since this function returns, processing has completed and attributes have
     * been updated.
     */
    finishLogin($authProcState);
} catch (Exception $exception) {
    throw new SimpleSAML_Error_Error('GENERATEAUTHNRESPONSE', $exception);
}
开发者ID:danielkjfrog,项目名称:docker,代码行数:31,代码来源:AssertionConsumerService.php

示例4: handleResponse

 /**
  * Handle a response from a SSO operation.
  *
  * @param array $state  The authentication state.
  * @param string $idp  The entity id of the IdP.
  * @param array $attributes  The attributes.
  */
 public function handleResponse(array $state, $idp, array $attributes)
 {
     assert('is_string($idp)');
     assert('array_key_exists("LogoutState", $state)');
     assert('array_key_exists("saml:logout:Type", $state["LogoutState"])');
     $idpMetadata = $this->getIdpMetadata($idp);
     $spMetadataArray = $this->metadata->toArray();
     $idpMetadataArray = $idpMetadata->toArray();
     $authProcState = array('saml:sp:IdP' => $idp, 'saml:sp:State' => $state, 'ReturnCall' => array('sspmod_saml_Auth_Source_SP', 'onProcessingCompleted'), 'Attributes' => $attributes, 'Destination' => $spMetadataArray, 'Source' => $idpMetadataArray);
     $pc = new SimpleSAML_Auth_ProcessingChain($idpMetadataArray, $spMetadataArray, 'sp');
     $pc->processState($authProcState);
     self::onProcessingCompleted($authProcState);
 }
开发者ID:hukumonline,项目名称:yii,代码行数:20,代码来源:SP.php


注:本文中的SimpleSAML_Auth_ProcessingChain::processState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。