Skip to content
Rafael D edited this page Oct 13, 2018 · 1 revision

How-To

Start Application

mvn spring-boot:run

Login using Basic HTTP Authorization:

curl -vk -u user:user localhost:8080/login

Look for your token in the response Authorization header:

Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiYXV0aHMiOiJST0xFX0FETUlOLFJPTEVfVVNFUiIsImlzcyI6InJhcGhhLmlvIiwiZXhwIjoxNTM5NDM2Nzg1fQ.3Dx_GLcnoM7mdFpJzMTKFRUWZQU9aNVMpvcO57QHj_M

Use that token to consume another endpoint:

curl -vk -H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyIiwiYXV0aHMiOiJST0xFX0FETUlOLFJPTEVfVVNFUiIsImlzcyI6InJhcGhhLmlvIiwiZXhwIjoxNTM5NDM2Nzg1fQ.3Dx_GLcnoM7mdFpJzMTKFRUWZQU9aNVMpvcO57QHj_M" localhost:8080/api/admin