JWT security autoconfigure
-
Represents Auto-configured Spring Security on Jwt based authentication for spring boot monolith applications
-
Maven:
<dependency> <groupId>com.github.cobrijani</groupId> <artifactId>jwt-security-spring-boot-starter</artifactId> <version>0.0.3</version> </dependency>
-
Gradle
compile('com.github.cobrijani:jwt-security-spring-boot-starter:0.0.3')
To use it:
-
Get dependency
-
Implement project specific classes below:
org.springframework.security.core.userdetails.UserDetails
org.springframework.security.core.userdetails.UserDetailsService
- POST on '/api/v1/login' with request body as below
{
"login": "user login in db or w/e",
"password": "user password",
"isRememberMe": "remember me"
}
- If 'UserDetails' and 'UserDetailsService' are successfully implement according to your project you should get something like this
{
"id_token": "your jwt"
}