0
votes
  • I ask for a token, it works :
POST auth-user.coi.im/login_check   {"username": "reader", "password": "reader"}
{"token": 
 eyJ0eXAiOiJKV..........................................................." }
  • without token : it's ok ! i have the error message
    auth-user.coi.im/api/users/1
{"code":401,"message":"JWT Token not found"}
  • with token :
auth-user.coi.im/api/users/1
Authorization Bearer eyJ0eXAiOiJKV...........................................................

Could not get any response There was an error connecting to auth-user.coi.im/api/users/1.

  • or with curl and with token:
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLC......................"

curl: (56) Recv failure: Connection was reset

HELP ! I have the same answer as if I put anything like url why, does it work on my computer and not on a remote server?

1

1 Answers

0
votes

If you use apache server, it will strip any Authorization header not in a valid HTTP BASIC AUTH format

Create a .htaccess file at the root of your project, and add this rule,

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

Found in the : jwt docs