Secure a Spring Boot REST API With JSON Web Token + Reference to Angular Integration
Nouhoun Y. Diarra

Excellent post, but i’m having a really hard time performing the first request in postman to retrieve a token, i have tried several ways and it has not worked for me. Could you post a working request? I could not configure it properly using the picture below that you posted for Hernan.

This is what postman is generating in code view:

curl -X POST \
 http://localhost:8080/oauth/token \
 -H ‘cache-control: no-cache’ \
 -H ‘client: testjwtclientid’ \
 -H ‘content-type: application/x-www-form-urlencoded’ \
 -H ‘postman-token: d8b20ba2–456c-2a82-df96-deeddcf99cb2’ \
 -H ‘secret: XY7kmzoNzl100’ \
 -d ‘grant_type=password&username=admin.admin&password=jwtpass’

And this is the response:

 “timestamp”: 1509052441279,
 “status”: 401,
 “error”: “Unauthorized”,
 “message”: “Full authentication is required to access this resource”,
 “path”: “/oauth/token”

Thanks in advance