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.

Bhaskar Monitor Asked on June 28, 2017 in Programming.
Add Comment
  • 1 Answer(s)

    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 eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjIxLCJpc3MiOiJodHRwOlwvXC9sb2NhbGhvc3Q6ODAwMFwvYXBpXC91c2VyXC9sb2dpbiIsImlhdCI6MTQ5ODU2MDkwMCwiZXhwIjoxNDk4NTY0NTAwLCJuYmYiOjE0OTg1NjA5MDAsImp0aSI6IlBIa2JYRFlGOW14OG5EcW8ifQ.46W5upXX_ws0d0wECbvZ5VQ8lYwAiDCpSwOPgFUS2w
    
    
    Bhaskar Monitor Answered on June 28, 2017.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.