user2099451
user2099451

Reputation: 647

Is it possible to convert Token from request string to Header in jwt authentication?

I'm using Tymon\JWTAuth with laravel and I'm sending the requests like this

 www.example.com/test?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjUzNywiaXNzIjoiaHR0cDpcL1wvbG9jYWxob3N0Ojg4ODhcL3YyXC9zZWxmXC9hdXRoZW50aWNhdGUiLCJpYXQiOjE0NzE0MzI0ODMsImV4cCI6MTQ3MTQ3NTY4MywibmJmIjoxNDcxNDMyNDgzLCJqdGkiOiI4ZDVlZGE4MmE2MTZlMzM5NjgwMmFmZTk5NWI3N2Q1MCJ9.-t0El5nJj_pgNzpgtLy8EVLUsf9dp8RTLhWA3cK_Vmw

I want to move this token to header is that possible ?

Upvotes: 1

Views: 1517

Answers (1)

Can Vural
Can Vural

Reputation: 2067

Yes. You can send the token with header.

From the documentation:

To make authenticated requests via http using the built in methods, you will need to set an authorization header as follows:

Authorization: Bearer {yourtokenhere}

Upvotes: 2

Related Questions