Spring Boot project with demonstration of OTP authentication technique.
- Create database with name otp
- Open terminal and navigate to your project
- Type command mvn install
- Type command mvn spring-boot:run
Route: http://localhost:8080/
- Development profile (dev)
- Production profile (prod)
Route: /auth/authenticate
Method: POST
Content-Type: application/json
Request payload: { username: "admin", password: "admin" }
Response: { id_token: "token_hash" }
-
Generate OTP and send it to e-mail
Route: /api/otp/generate
Method: POST
Empty request body in this case. -
Validate OTP
Route: /api/otp/validate
Method: POST
Example Request Payload: { "otp": "your otp number" }
- mvn clean
- mvn -Pprod package
Heril Muratović
Software Engineer
Mobile: +38269657962
E-mail: hedzaprog@gmail.com
Skype: hedza06
Twitter: hedzakirk
LinkedIn: https://www.linkedin.com/in/heril-muratovi%C4%87-021097132/
StackOverflow: https://stackoverflow.com/users/4078505/heril-muratovic