本文整理汇总了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);
}
示例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);
}
}
示例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;
}