Skip to content
This repository has been archived by the owner on Apr 14, 2020. It is now read-only.

Latest commit

 

History

History
56 lines (38 loc) · 1.32 KB

README.md

File metadata and controls

56 lines (38 loc) · 1.32 KB

demo-spring-boot-security-jwt

java-jdk spring-boot codecov

Web API

URL: http://localhost:8080

Authentication

Request

curl -i http://localhost:8080/login -H 'Content-Type: application/json' -d '{"username":"admin","password":"123"}' -X POST

Response

HTTP/1.1 200
Authorization: Bearer <your generated jwt>

Authenticated access

Request

curl -i http://localhost:8080/hello/world -H 'Authorization: Bearer <your generated jwt> '

Response

HTTP/1.1 200
Hello World!

Authenticated user details

Request

curl -i http://localhost:8080/user/details -H 'Authorization: Bearer <your generated jwt> '

Response

HTTP/1.1 200
admin