Reputation: 569
I'm using JWT token in my PHP Slim 4 framework. The code is working fine on local machine but when I push the code to google cloud, I'm getting error as Insecure use of middleware over HTTP denied by configuration.
Attaching screenshot of the error log :
Below is my JWT Config:
<?php
$ignoreUrl = "";
$app->add(new Tuupola\Middleware\JwtAuthentication([
"header" => "X-Token",
"regexp" => "/(.*)/",
"path" => "/public",
"secure" => true,
"secret" => "123456789",
"algorithm" => ["HS256"],
"ignore" => [
$ignoreUrl."/public/account/login",
$ignoreUrl."/public/account/logout"
],
"error" => function ($response, $arguments) {
$data["status"] = false;
$data["message"] = $arguments["message"];
return $response
->withHeader("Content-Type", "application/json")
->getBody()->write(json_encode($data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
}
]));
Tried a lot for the solution but nothing is working. Can you please suggest what's wrong in my code. Thank you in advance
Upvotes: 0
Views: 652
Reputation: 1
set, "secure" => false,
This will solve the issue. However, it is not recommended for use in live servers.
Upvotes: 0