Hi Everybody,
im new to Slim, i need implement jwt with slim, i use this https://github.com/tuupola/slim-jwt-auth
in the backend is fine, i try with this code only for example :
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
require '../vendor/autoload.php';
$app = new \Slim\App;
$app->add(new \Slim\Middleware\JwtAuthentication([
"secret"=>"supersecretkeyyoushouldnotcommittogithub",
]));
$app->get('/hello/{name}', function (Request $request, Response $response) {
$name = $request->getAttribute('name');
$response->getBody()->write("Hello, $name");
return $response;
});
$app->run();
the problem is when i call the api,i dont know how pass the jwt to the api, i try with autorization,
with header: “secret” “supersecretkeyyoushouldnotcommittogithub” but all return 401 not Unauthorized