https://github.com/igorbrizack/mfa-authentication-backend
Backend with a setup of MFA Authentication
https://github.com/igorbrizack/mfa-authentication-backend
docker express mfa-authenticator node postgres twillio typeorm typescript
Last synced: 3 months ago
JSON representation
Backend with a setup of MFA Authentication
- Host: GitHub
- URL: https://github.com/igorbrizack/mfa-authentication-backend
- Owner: IgorBrizack
- Created: 2024-10-28T01:40:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-20T17:35:53.000Z (over 1 year ago)
- Last Synced: 2025-03-04T04:42:00.201Z (over 1 year ago)
- Topics: docker, express, mfa-authenticator, node, postgres, twillio, typeorm, typescript
- Language: TypeScript
- Homepage:
- Size: 583 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🔐 Multi Factor Authentication - Backend
**`En-US`**
## About this project
This project will present how to create an API with JWT authentication / 2 factor authentication. To build this application I use **NodeJS + Express** to create the server, **TypeScript**, **POO and Clean Architecture**. Core lib selected to this project was **Twillio Authy** to provide our 2 factor authentication service and QRcode to generate the TOTP code with any code generator App. To have the full experience you will need to run the [Frontend](https://github.com/IgorBrizack/mfa-authentication-front) and start the server to interact.
## Steps
1. **Clone the repository**
```
git clone git@github.com:IgorBrizack/mfa-authentication-backend.git
```
2. **Create account at Twillio Website and setup your service configurations**
- Visit the [Twilio Website](https://www.twilio.com/login)
- Grab your Account SID and Auth Token
- Create your service under **Develop** >>> **Verify** and give it a name
- After creating the service, go to the service settings and **grab your Service SID**
- If you want, you can change the name that will appear in the authentication app under the TOTP option.
3. **Run with Docker**
```
docker-compose up -d --build
```
3. **Run with Node**
```
npm install
npm run dev
```
4. **Setup your envs** check the .env.example file
5. **The server will start at Port 3100 of your host**
6. **Start the [Frontend](https://github.com/IgorBrizack/mfa-authentication-front)**
---
**`Pt-BR`**
Este projeto apresentará como criar uma API com autenticação JWT e autenticação de dois fatores. Para construir esta aplicação, utilizei NodeJS + Express para criar o servidor, TypeScript, POO e Clean Architecture. A biblioteca principal escolhida para este projeto foi o Twilio Authy, que fornece o serviço de autenticação de dois fatores, e o QRCode para gerar o código TOTP com qualquer aplicativo gerador de código. Para uma experiência completa, será necessário rodar o [Frontend](https://github.com/IgorBrizack/mfa-authentication-front) e iniciar o servidor para interagir.
## Passos
1. **Clone o reporsitório**
```
git clone git@github.com:IgorBrizack/mfa-authentication-backend.git
```
2. **Crie uma conta no site do Twillio e implemente a configuração do seu serviço**
- Acesse [Twilio Website](https://www.twilio.com/login)
- Obtenha o Account SID e Auth Token
- Crie um serviço em **Develop** >>> **Verify** e dê a ele um nome.
- Após criar o serviço, vá até as configurações do serviço **pegue o Service SID**
- Se você quiser, na configuração do TOTP você pode selecionar o nome que irá aparecer no eu aplicativo de autenticação.
3. **Inicie com docker**
```
docker-compose up -d --build
```
3. **Inicie com Node**
```
npm install
npm run dev
```
4. **Defina suas váriaveis de ambiente** observe o arquivo .env.example
5. **O server será iniciado na porta 3100 do seu host**
6. **Inicie o [Frontend](https://github.com/IgorBrizack/mfa-authentication-front)**