implement spring security + toy jwt service
Stacks:
Springboot 2.5.1(Snapshot)
MySQL + SpringBoot JPA
Spring_Security
To implement this code, customize application.properties file to configure sources pertaining to the database.
1. User requests login access to /login with parameters, ID and pwd.-
In TestController, authenticate the user with ID and pwd, then JwtUtil creatToken and response the JWT token with header "Authorization".
-
With JWT token, User can access "/home" and TestController response "hello world"