Spring Boot 2.x example how to manage user registration with REST API
Spring Boot 2.7.5, REST, JPA, Security
- Java 11
- Postgres SQL database
- Create "sb-user-registration-1.0.0.jar"
- sudo update-alternatives --config java (select Java 11)
- gradle clean bootjar
- Run "sb-user-registration" application
java -jar sb-user-registration-1.0.0.jar
- Call REST endpoint to register user
POST http://localhost:8087/register
{
"firstName" : "Demo",
"lastName" : "User",
"email" : "demo@gmail.com",
"password" : "password",
"matchingPassword" : "password"
}
-
The security token has been sent to user email address.
-
After that you should call the following REST endpoint.
GET http://localhost:8087/verify?token=YOUR_TOKEN
- Additional REST endpoint list
- Resend security token
GET http://localhost:8087/resendToken?token=OLD_TOKEN
- Reset user password
POST http://localhost:8087/resetPassword
{
"email" : "demo@gmail.com"
}
Kenyeres Géza https://hu.linkedin.com/in/g%C3%A9za-kenyeres-17341631