Closed ithan1985 closed 8 years ago
Hi, token_invalid
means that the token you provide in header request is invalid. What kind of Web Server are you using?
i have a XAMPP packet, in htdoc i have a project named "lumen-jwt-master" in there i clone your project following step by step the Quick start
After that i puch in on service of apache from xampp port 55555 (all normally),
when you entry in http://localhost:55555/lumen-jwt-master/public/
you'll have a error Sorry, the page you are looking for could not be found. NotFoundHttpException in RoutesRequests.php line 443.
to fix that i only change in public/index.php
line 28 $app->run()
by $app->run($app->make('request'))
so when you entry http://localhost:55555/lumen-jwt-master/public/
you´ll have a message {"error":"token_not_provided"}
that normal tobecause you don't sending anything.
In fact to Make a POST request to /auth/login
using POSTMAN
Getting Status 200 OK Header
Cache-Control →no-cache
Connection →close
Content-Length →364
Content-Type →application/json
Date →Tue, 12 Apr 2016 14:04:59 GMT
Server →Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.5.33
X-Powered-By →PHP/5.5.33
Body
{
"success": {
"message": "token_generated",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdDo1NTU1NVwvbHVtZW4tand0LW1hc3RlclwvcHVibGljXC9hdXRoXC9sb2dpbiIsImlhdCI6MTQ2MDQ2OTg5OSwiZXhwIjoxNDYwNDczNDk5LCJuYmYiOjE0NjA0Njk4OTksImp0aSI6ImFjMzY1ODJlYzVhNWEzY2VjMzVkODAzNWY3MzZlZmUzIn0.qq_ww3eg0ZfKTwwo_51rmGQZTpO8OyVTCg7EkMH38sM"
}
}
Every thing well !!!!
But i don´t know how test get request when you entry is http://localhost:55555/lumen-jwt-master/public/user
the answer is {"error":"token_not_provided"}
thank again for your time
Hi @ithan1985 , do you provide your token when accessing http://localhost:55555/lumen-jwt-master/public/user
? You can attach your header configuration from your postman here. I reproduce this issue, but everything works fine.
You might use this to validate whether this is a bug:
curl http://localhost:55555/lumen-jwt-master/public/user --header "Authorization: Bearer YOUR_TOKEN_GOES_HERE"
Does app still says token_not_provided
?
Hello Master
I hope you 're well, i have a little question about how should do the get test, so now i´m using Postman, where in headers i have Key=Authorization and value= Bearer with the token, for example:
TESTING /auth/login
POST TO ...../auth/login
Headers Key=Accept value=application/json
Body Key=email value=johndoe@example.com Key=password value=johndoe
The result is Status: 200 OK { "success": { "message": "token_generated", "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdDoxMDAwMFwvZ3BpdEJhY2tlbmRcL3B1YmxpY1wvYXV0aFwvbG9naW4iLCJpYXQiOjE0NjA0Mjg4MTYsImV4cCI6MTQ2MDQzMjQxNiwibmJmIjoxNDYwNDI4ODE2LCJqdGkiOiI4YzM2N2E3OTdlZTZjMjRmMTUwOGM4M2Y5ZDEzMWRlNyJ9.T4g9FGEAW___ki5xBrBT-k6YZqdmt1lvYH39vi7SVLw" } }
TESTING /user
GET TO ....../user Headers Key=Authorization value=Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdDoxMDAwMFwvZ3BpdEJhY2tlbmRcL3B1YmxpY1wvYXV0aFwvbG9naW4iLCJpYXQiOjE0NjA0Mjg4MTYsImV4cCI6MTQ2MDQzMjQxNiwibmJmIjoxNDYwNDI4ODE2LCJqdGkiOiI4YzM2N2E3OTdlZTZjMjRmMTUwOGM4M2Y5ZDEzMWRlNyJ9.T4g9FGEAW___ki5xBrBT-k6YZqdmt1lvYH39vi7SVLw
The result is Status: 400 Bad Request { "error": "token_invalid" }
i hope you can help us, thank for your time