0
  • 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 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.