SimpleSAML\Utils\HTTP::getSecurePOSTRedirectURL PHP Method

getSecurePOSTRedirectURL() private static method

Obtain a URL where we can redirect to securely post a form with the given data to a specific destination.
Author: Jaime Perez, UNINETT AS ([email protected])
private static getSecurePOSTRedirectURL ( string $destination, array $data ) : string
$destination string The destination URL.
$data array An associative array containing the data to be posted to $destination.
return string A URL which allows to securely post a form to $destination.
    private static function getSecurePOSTRedirectURL($destination, $data)
    {
        $session = \SimpleSAML_Session::getSessionFromRequest();
        $id = self::savePOSTData($session, $destination, $data);
        // encrypt the session ID and the random ID
        $info = base64_encode(Crypto::aesEncrypt($session->getSessionId() . ':' . $id));
        $url = Module::getModuleURL('core/postredirect.php', array('RedirInfo' => $info));
        return preg_replace('#^https:#', 'http:', $url);
    }