I am making REST API with Laravel. I have used jwt auth token system for user verification and authorization.
I can pass jwt token in a body and do authentication. But I am trying to pass in a header for GET, DELETE operation of REST APIs.
So please suggest me that how can I get jwt token from a header in laravel rest API.
jwt passing token in laravel rest APIs is a little bit different for than others.
To pass jwt token headers we need to like this:
Headers:
Syntax:
Authorization: Bearer JWT_TOKEN
Example:
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUz I1NiJ9. eyJzdWIiOjIxLCJpc3MiOiJodHRwOl wvXC9sb2NhbGhvc3Q6ODAwMFwvYXBp XC91c2VyXC9sb2dpbiIsImlhdCI6MT Q5ODU2MDkwMCwiZXhwIjoxNDk4NTY0 NTAwLCJuYmYiOjE0OTg1NjA5MDAsIm p0aSI6IlBIa2JYRFlGOW14OG5EcW8i fQ.46W5upXX_ ws0d0wECbvZ5VQ8lYwAiDCpSwOPgFU S2w