当前位置: 首页>>代码示例>>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;未经允许,请勿转载。