An educational project with Spring Framework examples. Used for lectures at courses.
MIT License
Please note that IntelliJ IDEA HTTP Client was used to perform requests in code snippets
Please follow the steps to perform a demo of how to get a JWT token for an existing user:
POST http://localhost:8080/login?username=user&password=user
Accept: application/json
Authorization: Bearer <token>
HTTP/1.1 200
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ1c2VyIiwiZXhwIjoxNjc4ODM2OTY1fQ.Afagk8no-r2kUiDOdtjWMT06gYPHkrhCoOSoK5_X6k8BC8Lr6k5rB-9gyoE72-lkd0rx1sEPET-3Uf7KP-7BrQ
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 0
Date: Tue, 14 Mar 2023 23:35:05 GMT
Keep-Alive: timeout=60
Connection: keep-alive
<Response body is empty>
Authorization: Bearer <token>
headerGET http://localhost:8080/users/me
Accept: application/json
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ1c2VyIiwiZXhwIjoxNjc4ODM1NjE5fQ.cRZ1ob4XZfG5RnU0jl2kdPihc9Ln-BlEOe7hbuwZJWp-UuQSGukI_57pWrBcdaCWPN-8luCF08YWU74tUErOFg