secure spring-boot APIs with JWT
curl http://localhost:8080/hello
curl -H "Content-Type: application/json" -X POST -d '{ "username": "admin", "password": "password" }' http://localhost:8080/users/signup
curl -i -H "Content-Type: application/json" -X POST -d '{ "username": "admin", "password": "password" }' http://localhost:8080/login
将请求中的XXXXXX替换成拿到的token,这次可以成功调用接口了
curl -H "Content-Type: application/json"
-H "Authorization: Bearer XXXXXX"
"http://localhost:8080/hello"