DEV Community

Discussion on: Spring Security with JWT

Collapse
 
fmukendi profile image
fmukendi

Hi . Could you please explain where you got the JWT Token From?
When doing the operation below

GET http://localhost:8080/api/private
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJzZWN1cmUtYXBpIiwiYXVkIjoic2VjdXJlLWFwcCIsInN1YiI6InVzZXIiLCJleHAiOjE1NDgyNDI1ODksInJvbCI6WyJST0xFX1VTRVIiXX0.GzUPUWStRofrWI9Ctfv2h-XofGZwcOog9swtuqg1vSkA8kDWLcY3InVgmct7rq4ZU3lxI6CGupNgSazypHoFOA
Collapse
 
kubadlo profile image
Jakub Leško

Hi. You can find JWT in HTTP header Authorization in response from /api/authenticate.

Collapse
 
morensya93 profile image
Faisal Morensya

But from your post it says <Response body is empty>

This response body should be the token right?

Thread Thread
 
kubadlo profile image
Jakub Leško

Yes, response body is empty since JWT is sent via HTTP header.
I'll update that code snipped since it's bit confusing.