This repository contains a source code for the post on 2fa authentication for Spring Webflux APIs.
In this article I will show how to write a two-factor authentication for reactive API, built with Spring Webflux. This app uses TOTP (one-time codes, generated by app on the user device – like Google Authenticator) as the second security factor, alongside with email and password pairs.
To run this code, please ensure that your system satisfies following tech requirements:
- Java 11 +
- Maven
- MongoDB (to store data)
- Clone this repository
- Set Mongodb in
application.properties
asspring.data.mongodb.uri
param - In command line execute
spring-boot:run
- Access app on
http://localhost:8080
2020 Yuri Mednikov
This code is provided under MIT license. Use it on your own risk :)