Skip to content

burakfircasiguzel/SpringBoot-2FA-OTP-SMS-Twilio-H2Database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Springboot 2FA OTP SMS with Twilio

SpringBoot-2FA-OTP-SMS-Twilio-H2Database

Two Factor Authentication Usage & Sending OTP SMS Using Twilio

🧐 Features

Here're some of the project's best features:

  • Two Factor Authentication (2FA)
  • One Time Password (OTP)
  • Sending SMS

🛠️ Installation Steps:


1. 1

- Note: You can also work with another SMS provider, I chose Twilio in this project.
- Register from this address first ->  www.twilio.com
- Enter the API information you got from Twilio into application.yml

twilio:
  account_sid: #your account sid
  auth_token: #your auth token
  trial_number: # your trial number

1. 2

- Run the application

🎈 Usage Steps:

1 - Register

  • To register first, Make a POST request at "/user/register" like a
{
    "username" : "burak",
    "password" : "123456",
    "telephoneNumber": "+905555555555"   
}



2 - Normal Login

- To normal login, Make a POST request at "/user" like a
{
    "username" : "burak",
    "password" : "123456"
}
  • If the credentials are correct , an OTP code will be sent to the phone number registered via SMS.



3 - Login with OTP Code

- Add the code in the incoming SMS to the request
- To OTP login, Make a POST request at "/user/secret" like a
{
    "username" : "burak",
    "code" : "148253"
}
  • If the code is correct, it will return the message "Welcome to the hidden page".
  • That's it.

💻 Built with

Technologies used in the project:

  • Java
  • Springboot
  • H2 Database
  • Two Factor Authentication
  • One Time Password

About

Two Factor Authentication Usage & Sending OTP SMS using Twilio

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages