2FA device alert using biometric security.
This project is only a demo for educational purpose and is absolutely not secured. You can if you want, implement a key ceremony to encrypt all that stuff.
Note : The code can be crappy sometimes, this project has been made during an intensive project week and there were a lot of stuff to do in the same time, not only this application.
This project is under a GPL3 License and use the AlexisL61's Flutter Template.
This app runs a websocket open on the 9897 port using a background service, and wait for a login attempt from whatever service, (example: we use it from a 2FA Authentik SSO).
You receive a notification, then it ask you to approve/reject the attempt. If you want to approve, it use face recognition to verify that you're the right personne, if approved, it sends an 'ok/yes' message to the service.
- Install Flutter : https://docs.flutter.dev/get-started/install
- Launch with provider (debug) :
flutter run -t ./lib/main.dart
- Launch with provider (release) :
flutter run -t ./lib/main.dart --release
This template use two providers to split the repositories in case you are not in the same environment. There are two providers that are not implemented :
- Live : Which take a baseUrl to communicate with an api
- Dummy : Which use static string to simulate the communication to the api
To split this behavior, each provider instantiate their own repositories in their provider file (dummy will instantiate the DummyExampleRepository and live will instantiate the LiveExampleRepository).
Components are used to store small widget that can be reused by any page or dialog of the app.
They can be either :
- An atom : A small widget
- A molecule : A widget containing atoms
- An organism : A widget containing molecules
If a component behavior become too big, there should be a ViewModel with it
The model contains every data class and the core concept of the Model-View-ViewModel.
Pages contains every pages of the app. It's a screen the user will see containing components and specific widget
Every pages should at least have a ViewModel.
The providers help you splitting your code behavior depending of the environment.
Every repository give you a way to retrieve data and create data class with it. They can only be called from Services.
Every services helps you calling repositories and transformers to retrieve data as you want.
Transformers let you transform data, from one class to an another. They can only be called from Services.
Utils contain every extensions for the project. It can be extensions for base class (e.g. string, int, boolean) and for specific classes too.
flowchart LR
Page
ViewModel
Component
Service
Transformer
Repository
DataClass[Data class]
Page<-->ViewModel
Page<-->Component
ViewModel-->Service
Service-->Transformer
Service-->Repository
Component .->ViewModel
Repository-- Create -->DataClass
Transformer-- Transform -->DataClass