Fix in case token comes through with HTTP instead of HTTPS

This commit is contained in:
Angus B. Grieve-Smith 2020-04-24 16:50:30 -04:00
parent 0c1eaf3a31
commit 5a388efa14
1 changed files with 6 additions and 1 deletions

View File

@ -8,5 +8,10 @@
require_once __DIR__.'/server.php';
// Handle a request for an OAuth2.0 Access Token and send the response to the client
error_log("token.php \$_POST = " . json_encode($_POST));
if (substr($_POST["redirect_uri"],0,5) == "http:") {
$_POST["redirect_uri"] = "https" . substr($_POST["redirect_uri"],4);
}
$server->handleTokenRequest(OAuth2\Request::createFromGlobals())->send();
?>