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


PHP SimpleSAML_Auth_Simple::getAuthDataArray方法代碼示例

本文整理匯總了PHP中SimpleSAML_Auth_Simple::getAuthDataArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleSAML_Auth_Simple::getAuthDataArray方法的具體用法?PHP SimpleSAML_Auth_Simple::getAuthDataArray怎麽用?PHP SimpleSAML_Auth_Simple::getAuthDataArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SimpleSAML_Auth_Simple的用法示例。


在下文中一共展示了SimpleSAML_Auth_Simple::getAuthDataArray方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: reauthenticate

 /**
  * Reuthenticate the user.
  *
  * This function reauthenticates an user with an existing session. This
  * gives the authentication source a chance to do additional work when
  * reauthenticating for SSO.
  *
  * Note: This function is not used when ForceAuthn=true.
  *
  * @param array &$state  The authentication request state.
  */
 private function reauthenticate(array &$state)
 {
     $sourceImpl = $this->authSource->getAuthSource();
     if ($sourceImpl === NULL) {
         /* Backwards-compatibility with non-authsource IdP. */
         foreach ($this->authSource->getAuthDataArray() as $k => $v) {
             $state[$k] = $v;
         }
         return;
     }
     $sourceImpl->reauthenticate($state);
 }
開發者ID:shirlei,項目名稱:simplesaml,代碼行數:23,代碼來源:IdP.php

示例2: handleAuthenticationRequest

 /**
  * Process authentication requests.
  *
  * @param array &$state  The authentication request state.
  */
 public function handleAuthenticationRequest(array &$state)
 {
     assert('isset($state["Responder"])');
     $state['core:IdP'] = $this->id;
     if (isset($state['SPMetadata']['entityid'])) {
         $spEntityId = $state['SPMetadata']['entityid'];
     } elseif (isset($state['SPMetadata']['entityID'])) {
         $spEntityId = $state['SPMetadata']['entityID'];
     } else {
         $spEntityId = NULL;
     }
     $state['core:SP'] = $spEntityId;
     /* First, check whether we need to authenticate the user. */
     if (isset($state['ForceAuthn']) && (bool) $state['ForceAuthn']) {
         /* Force authentication is in effect. */
         $needAuth = TRUE;
     } elseif (isset($state['saml:IDPList']) && sizeof($state['saml:IDPList']) > 0) {
         $needAuth = TRUE;
     } else {
         $needAuth = !$this->isAuthenticated();
     }
     try {
         if ($needAuth) {
             $this->authenticate($state);
             assert('FALSE');
         } else {
             foreach ($this->authSource->getAuthDataArray() as $k => $v) {
                 $state[$k] = $v;
             }
         }
         $this->postAuth($state);
     } catch (SimpleSAML_Error_Exception $e) {
         SimpleSAML_Auth_State::throwException($state, $e);
     } catch (Exception $e) {
         $e = new SimpleSAML_Error_UnserializableException($e);
         SimpleSAML_Auth_State::throwException($state, $e);
     }
 }
開發者ID:filonuse,項目名稱:fedlab,代碼行數:43,代碼來源:IdP.php

示例3: getAuthData

 /**
  * @param SimpleSAML_Auth_Simple $auth The authentication context as returned from RealMe
  * @return ArrayData
  */
 private function getAuthData(SimpleSAML_Auth_Simple $auth)
 {
     // returns null if the current auth is invalid or timed out.
     $data = $auth->getAuthDataArray();
     $returnedData = null;
     if (is_array($data) && isset($data['saml:sp:IdP']) && isset($data['saml:sp:NameID']) && is_array($data['saml:sp:NameID']) && isset($data['saml:sp:NameID']['Value']) && isset($data['Expire']) && isset($data['Attributes']) && isset($data['saml:sp:SessionIndex'])) {
         $returnedData = new ArrayData(array('NameID' => new ArrayData($data['saml:sp:NameID']), 'UserFlt' => $data['saml:sp:NameID']['Value'], 'Attributes' => new ArrayData($data['Attributes']), 'Expire' => $data['Expire'], 'SessionIndex' => $data['saml:sp:SessionIndex']));
     }
     return $returnedData;
 }
開發者ID:silverstripe,項目名稱:silverstripe-realme,代碼行數:14,代碼來源:RealMeService.php


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