Compare commits
1 Commits
frankenphp
...
poc-2fa
Author | SHA1 | Date | |
---|---|---|---|
148f05ef79 |
4
.env
4
.env
@@ -14,7 +14,7 @@
|
||||
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
|
||||
|
||||
###> symfony/framework-bundle ###
|
||||
APP_ENV=prod
|
||||
APP_ENV=dev
|
||||
APP_SECRET=406ccaa0c76a451fdcc2307ea146cbef
|
||||
URL_LINK="http://localhost"
|
||||
|
||||
@@ -44,3 +44,5 @@ ALTCHA_WORKERS=8
|
||||
ALTCHA_DELAY=100
|
||||
ALTCHA_MOCK_ERROR=false
|
||||
ALTCHA_ENABLED=true
|
||||
|
||||
ENABLED_2FA=true
|
14
compose.yml
14
compose.yml
@@ -59,7 +59,6 @@ services:
|
||||
- HASH_ALGO_LEGACY="sha256"
|
||||
- SECURITY_PATTERN=password,salt,pepper
|
||||
- CADDY_HTTP_PORT=8071
|
||||
|
||||
oidc-test:
|
||||
image: bornholm/oidc-test:v0.0.0-1-g936a77e
|
||||
environment:
|
||||
@@ -158,6 +157,19 @@ services:
|
||||
image: reg.cadoles.com/cadoles/altcha:2024.10.29-develop.1213.22e038b
|
||||
environment:
|
||||
ALTCHA_HMAC_KEY: 'change_me'
|
||||
hydra-2fa:
|
||||
build:
|
||||
context: ../hydra-2fa # Répertoire du sous-projet
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- ../hydra-2fa:/app # Montage pour synchronisation en temps réel (ajuste si le WORKDIR change)
|
||||
environment:
|
||||
- APP_ENV=dev
|
||||
- APP_DEBUG=1 # Pour mode debug en dev
|
||||
ports:
|
||||
- "8070:80" # Mappe le port 80 du conteneur sur 8081 de l'hôte
|
||||
depends_on:
|
||||
- mariadb # Si tu utilises la DB partagée
|
||||
volumes:
|
||||
postgres:
|
||||
mariadb:
|
||||
|
@@ -51,7 +51,9 @@ services:
|
||||
App\Hydra\HydraService:
|
||||
arguments:
|
||||
$baseUrl: '%base_url%'
|
||||
|
||||
App\Controller\MainController:
|
||||
arguments:
|
||||
$enabled2fa: '%env(bool:ENABLED_2FA)%'
|
||||
App\SQLLogin\SQLLoginRequest:
|
||||
arguments:
|
||||
$config: []
|
||||
|
@@ -20,8 +20,9 @@ class MainController extends AbstractController
|
||||
public function __construct(
|
||||
private readonly RequestStack $requestStack,
|
||||
private readonly HydraService $hydra,
|
||||
private readonly Client $client
|
||||
){
|
||||
private readonly Client $client,
|
||||
private readonly bool $enabled2fa
|
||||
) {
|
||||
}
|
||||
|
||||
#[Route('/', name: 'app_home')]
|
||||
@@ -42,6 +43,8 @@ class MainController extends AbstractController
|
||||
#[Route('/connect/login-accept', name: 'app_login_accept', methods: ['GET'])]
|
||||
public function loginAccept(SQLLoginRequest $sqlLoginRequest): RedirectResponse
|
||||
{
|
||||
dd($this->enabled2fa);
|
||||
|
||||
$user = $this->getUser();
|
||||
|
||||
if (!$user instanceof User) {
|
||||
|
Reference in New Issue
Block a user