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


PHP HTTP::redirectUntrustedURL方法代码示例

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


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

示例1: handleUnsolicitedAuth

 /**
  * Handle an unsolicited login operations.
  *
  * This method creates a session from the information received. It will then redirect to the given URL. This is used
  * to handle IdP initiated SSO. This method will never return.
  *
  * @param string $authId The id of the authentication source that received the request.
  * @param array $state A state array.
  * @param string $redirectTo The URL we should redirect the user to after updating the session. The function will
  * check if the URL is allowed, so there is no need to manually check the URL on beforehand. Please refer to the
  * 'trusted.url.domains' configuration directive for more information about allowing (or disallowing) URLs.
  */
 public static function handleUnsolicitedAuth($authId, array $state, $redirectTo)
 {
     assert('is_string($authId)');
     assert('is_string($redirectTo)');
     $session = SimpleSAML_Session::getSessionFromRequest();
     $session->doLogin($authId, SimpleSAML_Auth_State::getPersistentAuthData($state));
     \SimpleSAML\Utils\HTTP::redirectUntrustedURL($redirectTo);
 }
开发者ID:simplesamlphp,项目名称:simplesamlphp,代码行数:20,代码来源:SP.php

示例2: redirectUntrustedURL

 /**
  * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::redirectUntrustedURL() instead.
  */
 public static function redirectUntrustedURL($url, $parameters = array())
 {
     \SimpleSAML\Utils\HTTP::redirectUntrustedURL($url, $parameters);
 }
开发者ID:jstormes,项目名称:simplesamlphp,代码行数:7,代码来源:Utilities.php

示例3: loadState

 /**
  * Retrieve saved state.
  *
  * This function retrieves saved state information. If the state information has been lost,
  * it will attempt to restart the request by calling the restart URL which is embedded in the
  * state information. If there is no restart information available, an exception will be thrown.
  *
  * @param string $id  State identifier (with embedded restart information).
  * @param string $stage  The stage the state should have been saved in.
  * @param bool $allowMissing  Whether to allow the state to be missing.
  * @return array|NULL  State information, or NULL if the state is missing and $allowMissing is TRUE.
  */
 public static function loadState($id, $stage, $allowMissing = FALSE)
 {
     assert('is_string($id)');
     assert('is_string($stage)');
     assert('is_bool($allowMissing)');
     SimpleSAML_Logger::debug('Loading state: ' . var_export($id, TRUE));
     $sid = self::parseStateID($id);
     $session = SimpleSAML_Session::getSessionFromRequest();
     $state = $session->getData('SimpleSAML_Auth_State', $sid['id']);
     if ($state === NULL) {
         /* Could not find saved data. */
         if ($allowMissing) {
             return NULL;
         }
         if ($sid['url'] === NULL) {
             throw new SimpleSAML_Error_NoState();
         }
         \SimpleSAML\Utils\HTTP::redirectUntrustedURL($sid['url']);
     }
     $state = unserialize($state);
     assert('is_array($state)');
     assert('array_key_exists(self::ID, $state)');
     assert('array_key_exists(self::STAGE, $state)');
     /* Verify stage. */
     if ($state[self::STAGE] !== $stage) {
         /* This could be a user trying to bypass security, but most likely it is just
          * someone using the back-button in the browser. We try to restart the
          * request if that is possible. If not, show an error.
          */
         $msg = 'Wrong stage in state. Was \'' . $state[self::STAGE] . '\', should be \'' . $stage . '\'.';
         SimpleSAML_Logger::warning($msg);
         if ($sid['url'] === NULL) {
             throw new Exception($msg);
         }
         \SimpleSAML\Utils\HTTP::redirectUntrustedURL($sid['url']);
     }
     return $state;
 }
开发者ID:tractorcow,项目名称:simplesamlphp,代码行数:50,代码来源:State.php

示例4: SimpleSAML_Error_BadRequest

<?php

/*
 * Helper page for starting a admin login. Can be used as a target for links.
 */
if (!array_key_exists('ReturnTo', $_REQUEST)) {
    throw new SimpleSAML_Error_BadRequest('Missing ReturnTo parameter.');
}
SimpleSAML\Utils\Auth::requireAdmin();
\SimpleSAML\Utils\HTTP::redirectUntrustedURL($_REQUEST['ReturnTo']);
开发者ID:PitcherAG,项目名称:simplesamlphp,代码行数:10,代码来源:login-admin.php


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