redirectTo() публичный метод

Redirects the user to the url past by parameter or to the url that we defined in our SSO Request.
public redirectTo ( string $url = '', array $parameters = [], boolean $stay = false )
$url string The target URL to redirect the user.
$parameters array Extra parameters to be passed as part of the url
$stay boolean True if we want to stay (returns the url string) False to redirect
Пример #1
0
     }
     $auth->processResponse($requestID);
     $errors = $auth->getErrors();
     if (!empty($errors)) {
         print_r('<p>' . implode(', ', $errors) . '</p>');
     }
     if (!$auth->isAuthenticated()) {
         echo "<p>Not authenticated</p>";
         exit;
     }
     $_SESSION['samlUserdata'] = $auth->getAttributes();
     $_SESSION['samlNameId'] = $auth->getNameId();
     $_SESSION['samlSessionIndex'] = $auth->getSessionIndex();
     unset($_SESSION['AuthNRequestID']);
     if (isset($_POST['RelayState']) && OneLogin_Saml2_Utils::getSelfURL() != $_POST['RelayState']) {
         $auth->redirectTo($_POST['RelayState']);
     }
 } else {
     if (isset($_GET['sls'])) {
         if (isset($_SESSION) && isset($_SESSION['LogoutRequestID'])) {
             $requestID = $_SESSION['LogoutRequestID'];
         } else {
             $requestID = null;
         }
         $auth->processSLO(false, $requestID);
         $errors = $auth->getErrors();
         if (empty($errors)) {
             print_r('<p>Sucessfully logged out</p>');
         } else {
             print_r('<p>' . implode(', ', $errors) . '</p>');
         }