182 lines
5.2 KiB
Markdown
182 lines
5.2 KiB
Markdown
---
|
|
title: 2FAuth
|
|
created: 2026-06-06
|
|
updated: 2026-06-06
|
|
type: app
|
|
tags: [catalogue, 2FA, security, php, web-based]
|
|
confidence: high
|
|
contested: false
|
|
sources: [https://selfh.st/apps/?tag=2FA, https://github.com/Bubka/2FAuth]
|
|
---
|
|
# 🔐 2FAuth
|
|
|
|
> **Gestionnaire de codes 2FA web-based**, self-hosted. Une alternative simple à Google Authenticator avec sync et accès multi-appareils.
|
|
|
|
## 📋 Informations Générales
|
|
|
|
| Champ | Valeur |
|
|
| :--- | :--- |
|
|
| **Site web** | [2fauth.app](https://2fauth.app) |
|
|
| **GitHub** | [Bubka/2FAuth](https://github.com/Bubka/2FAuth) |
|
|
| **License** | AGPL-3.0 |
|
|
| **Langage** | PHP (Laravel) |
|
|
| **Étoiles GitHub** | 4k ⭐ |
|
|
| **Dernière MAJ** | 2026-04-03 |
|
|
| **Catégorie** | [[cat-2fa|2FA]] |
|
|
| **Note** | 100% gratuit, pas d'édition payante |
|
|
|
|
## 📝 Description
|
|
|
|
**2FAuth** est une application web qui vous permet de gérer vos codes 2FA depuis n'importe quel navigateur, avec :
|
|
|
|
- **Interface web responsive** (utilisable sur mobile aussi)
|
|
- **Multi-utilisateurs** (auth intégrée)
|
|
- **Organisation par groupes** et tags
|
|
- **Catégories** pour les trier
|
|
- **Icônes** auto-détectées pour les services connus
|
|
- **Import/Export** : depuis Google Authenticator, Aegis, etc.
|
|
- **API REST** pour intégrations
|
|
- **OAuth2/OIDC** pour login externe (Google, GitHub, etc.)
|
|
- **WebAuthn** pour le login 2FA
|
|
- **Mode hors-ligne** (PWA)
|
|
|
|
**Différence avec Ente Auth** : 2FAuth est 100% **self-hosted** et **web-based** (pas d'app native). Idéal si vous voulez un serveur que vous contrôlez totalement.
|
|
|
|
## 🚀 Installation
|
|
|
|
### Option 1 : Docker Compose (recommandé)
|
|
|
|
```yaml
|
|
# docker-compose.yml
|
|
version: '3.8'
|
|
services:
|
|
2fauth:
|
|
image: 2fauth/2fauth:latest
|
|
container_name: 2fauth
|
|
restart: unless-stopped
|
|
environment:
|
|
- APP_NAME=2FAuth
|
|
- APP_ENV=production
|
|
- APP_KEY=base64:VOTRE_CLE_32_CHARS_ICI=
|
|
- APP_URL=https://2fa.example.com
|
|
- LOG_CHANNEL=stack
|
|
- LOG_LEVEL=info
|
|
- DB_CONNECTION=sqlite
|
|
- DB_DATABASE=/var/www/html/database/2fauth.sqlite
|
|
- CACHE_DRIVER=file
|
|
- SESSION_DRIVER=file
|
|
- SESSION_LIFETIME=120
|
|
- MAIL_MAILER=smtp
|
|
- MAIL_HOST=*** - MAIL_PORT=587
|
|
- MAIL_USERNAME=***
|
|
- MAIL_PASSWORD=*** - MAIL_ENCRYPTION=tls
|
|
- MAIL_FROM_ADDRESS=no-reply@example.com
|
|
- MAIL_FROM_NAME=2FAuth
|
|
- AUTHENTICATION_GUARD=web
|
|
- 2FAUTH_IS_DEMO_APP=false
|
|
volumes:
|
|
- 2fauth-data:/var/www/html/database
|
|
- 2fauth-logs:/var/www/html/storage/logs
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.2fauth.rule=Host(`2fa.example.com`)"
|
|
- "traefik.http.routers.2fauth.entrypoints=websecure"
|
|
- "traefik.http.routers.2fauth.tls.certresolver=letsencrypt"
|
|
- "traefik.http.services.2fauth.loadbalancer.server.port=80"
|
|
networks:
|
|
- proxy
|
|
|
|
volumes:
|
|
2fauth-data:
|
|
2fauth-logs:
|
|
|
|
networks:
|
|
proxy:
|
|
external: true
|
|
```
|
|
|
|
### Option 2 : Avec MySQL (production)
|
|
|
|
```yaml
|
|
version: '3.8'
|
|
services:
|
|
2fauth:
|
|
image: 2fauth/2fauth:latest
|
|
container_name: 2fauth
|
|
restart: unless-stopped
|
|
environment:
|
|
- APP_URL=https://2fa.example.com
|
|
- DB_CONNECTION=mysql
|
|
- DB_HOST=db
|
|
- DB_PORT=3306
|
|
- DB_DATABASE=2fauth
|
|
- DB_USERNAME=2fauth
|
|
- DB_PASSWORD=*** depends_on:
|
|
- db
|
|
volumes:
|
|
- 2fauth-data:/var/www/html/storage
|
|
# ... labels comme ci-dessus
|
|
|
|
db:
|
|
image: mariadb:10.11
|
|
container_name: 2fauth-db
|
|
restart: unless-stopped
|
|
environment:
|
|
- MARIADB_DATABASE=2fauth
|
|
- MARIADB_USER=2fauth
|
|
- MARIADB_PASSWORD=*** - MARIADB_RANDOM_ROOT_PASSWORD=*** volumes:
|
|
- 2fauth-db:/var/lib/mysql
|
|
|
|
volumes:
|
|
2fauth-data:
|
|
2fauth-db:
|
|
```
|
|
|
|
## ⚙️ Configuration Initiale
|
|
|
|
1. **Générer une APP_KEY** :
|
|
```bash
|
|
docker run --rm 2fauth/2fauth:latest php artisan key:generate --show
|
|
```
|
|
2. **Lancer le conteneur** avec cette clé
|
|
3. **Créer le premier compte** via l'UI
|
|
4. **Configurer SMTP** pour la récupération de mot de passe
|
|
5. **Importer vos codes 2FA existants** :
|
|
- Depuis Google Authenticator : exporter en QR
|
|
- Depuis Aegis : export JSON
|
|
- Manuellement : ajouter un par un
|
|
|
|
## 🔄 Alternatives
|
|
|
|
### Open Source
|
|
- [[app-ente-auth]] — Mobile/desktop natif, E2E
|
|
- [[app-vaultwarden]] — Inclut 2FA dans le password manager
|
|
- [[app-defguard]] — VPN + 2FA intégré
|
|
- **Aegis** (Android only) — Populaire, local-only
|
|
- **Authenticator CC** — Open source, par l'équipe Bitwarden
|
|
|
|
### Propriétaires (ce que 2FAuth remplace)
|
|
- **Google Authenticator** — Pas de sync, pas chiffré
|
|
- **Authy** — Demande un numéro de téléphone
|
|
- **Microsoft Authenticator** — Tracking Microsoft
|
|
|
|
## 🔐 Sécurité
|
|
|
|
- **Chiffrement des secrets 2FA** au repos (chiffrement Laravel)
|
|
- **2FA pour l'accès à 2FAuth** : supporté (TOTP, WebAuthn)
|
|
- **Session timeout** : configurable
|
|
- **HTTPS obligatoire** (ne pas exposer en HTTP)
|
|
- **Pas de tracking** : 100% self-hosted
|
|
|
|
## 📚 Ressources
|
|
|
|
- [Documentation officielle](https://docs.2fauth.app/)
|
|
- [GitHub Bubka/2FAuth](https://github.com/Bubka/2FAuth)
|
|
- [Démo en ligne](https://demo.2fauth.app/)
|
|
|
|
## Pages Liées
|
|
- [[cat-2fa]] — Catégorie 2FA
|
|
- [[app-ente-auth]] — Alternative mobile/desktop
|
|
- [[app-vaultwarden]] — Password + 2FA
|
|
- [[traefik]] — Reverse proxy
|