From 5a388efa14b59443196df41986f83bf7fd2f780c Mon Sep 17 00:00:00 2001 From: "Angus B. Grieve-Smith" Date: Fri, 24 Apr 2020 16:50:30 -0400 Subject: [PATCH] Fix in case token comes through with HTTP instead of HTTPS --- oauth/token.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/oauth/token.php b/oauth/token.php index f0ad755..a15973c 100644 --- a/oauth/token.php +++ b/oauth/token.php @@ -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(); -?> \ No newline at end of file +?>