Deployment Guide

Table Of Contents
print("Redirected at: ");
print(date("Y-m-d H:i:sZ", $redirectedAt->getTimestamp()));
print("<br>");
print($now->getTimeZone()->getName());
print("<br>");
print($redirectedAt->getTimeZone()->getName());
print("<br>");
print($expires);
print("<br>");
print($delta);
return self::AWS4_ERROR_STALE_REQUEST;
}
return self::AWS4_ERROR_NONE;
}
/**
* Method to generate the AWS signed URL address
* @param string $pUrl: the URL that need to be appended with AWS parameters
* @param string $identity: the AWS identity
* @param string $sharedSecret: the secret shared with the controller
* @param string $region: the region component of the scope
* @param string $service: the service component of the scope
* @param int $expires: number of seconds till presigned URL is untrusted.
* @return URL string with AWS parameters
*/
public static function createPresignedUrl(
$pUrl, $identity, $sharedSecret, $region,
$service, $expires) {
$urlParams = parse_url($pUrl);
$httpDate = gmdate('Ymd\THis\Z', time());
$scopeDate = substr($httpDate, 0, 8);
$scope = "{$scopeDate}/".$region."/".$service."/".self::AWS4_EXTREME_REQUEST;
$credential = $identity . '/' . $scope;
$duration = $expires;
//set the aws parameters
$awsParams = array(
'X-Amz-Date'=>$httpDate,
'X-Amz-Algorithm'=> 'AWS4-HMAC-SHA256',
'X-Amz-Credential'=> $credential,
'X-Amz-SignedHeaders' =>'host',
'X-Amz-Expires'=> $duration
);
parse_str($urlParams['query'],$q);
$q = array_merge($q, $awsParams);
ksort($q);
$port = $urlParams['port'];
$host = strtolower($urlParams['host']);
if($port && (($urlParams['scheme']=='https' && $port !=
443)||($urlParams['scheme']=='http' && $port != 80))) {
$host .= ':'.$port;
}
$canonical_request = self::getCanonicalFFECPContent($q,
$host, $urlParams['path'], true);
$stringToSign = "AWS4-HMAC-SHA256\n{$httpDate}\n{$scope}\n" .
hash('sha256', $canonical_request);
$signingKey = self::getSigningKey(
$scopeDate,
$region,
$service,
$sharedSecret
);
$q['X-Amz-Signature'] = hash_hmac('sha256', $stringToSign,
$signingKey);
$p = substr($pUrl, 0, strpos($pUrl,'?'));
$queryParams = array();
crypt_aws_s4.php
PHP External Captive Portal, Controller’s Firewall
Friendly API
210 Extreme Campus Controller Deployment Guide for version 5.46.03