first commit symfony 6

This commit is contained in:
Arnaud Fornerot 2022-07-25 09:34:16 +02:00
parent 52736bc3f8
commit 2bba3d5695
5 changed files with 15 additions and 20 deletions

6
.env
View File

@ -15,8 +15,8 @@ MAILER_NOREPLY=noreply@noreply.fr
# Basic # Basic
APP_WEBURL=127.0.0.1:8000 APP_WEBURL=127.0.0.1:8000
APP_MASTERIDENTITY=SQL # SQL | SSO à faire | LDAP APP_MASTERIDENTITY=SQL # SQL | SSO | LDAP
APP_AUTH=SQL # SQL | CAS à faire | LDAP | OPENID | SAML APP_AUTH=SQL # SQL | CAS| LDAP | OPENID | à faire SAML
APP_ALIAS=/ APP_ALIAS=/
APP_NAME=Nineskeletor APP_NAME=Nineskeletor
APP_MASTERURL= APP_MASTERURL=
@ -31,7 +31,7 @@ APP_SYNCHRO= # Synchronisation null | LDAP2NINE | NINE2LDAP |
APP_SYNDCHROPURGENIVEAU01=1 # Purger les niveau01s obsolète en cas de synchronisation APP_SYNDCHROPURGENIVEAU01=1 # Purger les niveau01s obsolète en cas de synchronisation
APP_SYNDCHROPURGENIVEAU02=1 # Purger les niveau02s obsolète en cas de synchronisation APP_SYNDCHROPURGENIVEAU02=1 # Purger les niveau02s obsolète en cas de synchronisation
APP_SYNDCHROPURGEGROUP=1 # Purger les groups obsolète en cas de synchronisation APP_SYNDCHROPURGEGROUP=1 # Purger les groups obsolète en cas de synchronisation
APP_SYNDCHROPURGEUSER=1 # Purger les groups obsolète en cas de synchronisation APP_SYNDCHROPURGEUSER=1 # Purger les users obsolète en cas de synchronisation
# LDAP # LDAP
LDAP_HOST= # host du serveur ldap LDAP_HOST= # host du serveur ldap

4
.gitignore vendored
View File

@ -1,5 +1,5 @@
/docker-compose.override.ym /docker-compose.override.yml
/.env.local /.env.local
/.env.local.php /.env.local.php
/.env.*.local /.env.*.local
@ -26,4 +26,4 @@ yarn-error.log
!/public/uploads/avatar !/public/uploads/avatar
/public/uploads/logo/* /public/uploads/logo/*
!/public/uploads/logo/logo.png !/public/uploads/logo/logo.png
/public/uploads/ckeditor /public/uploads/ckeditor

View File

@ -37,7 +37,7 @@ app_loginldapcheck:
controller: App\Controller\SecurityController::loginldapcheck controller: App\Controller\SecurityController::loginldapcheck
app_loginopenidcallback: app_loginopenidcallback:
path: /loginopenidcallback path: /oauth2/callback
controller: App\Controller\SecurityController::loginopenidcallback controller: App\Controller\SecurityController::loginopenidcallback
app_logout: app_logout:

View File

@ -1,12 +0,0 @@
version: '3'
services:
mercure:
ports:
- "9090:80"
environment:
SERVER_NAME: ':80'
MERCURE_PUBLISHER_JWT_KEY: '!ChangeMe!'
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeMe!'
MERCURE_EXTRA_DIRECTIVES: |
cors_origins http://192.168.0.2

View File

@ -204,7 +204,7 @@ class SecurityController extends AbstractController
public function loginOPENID(Request $request, AuthenticationUtils $authenticationUtils) public function loginOPENID(Request $request, AuthenticationUtils $authenticationUtils)
{ {
$callback=$this->generateUrl('app_loginopenidcallback', array(), UrlGeneratorInterface::ABSOLUTE_URL); $callback=$this->generateUrl('app_loginopenidcallback', array(), UrlGeneratorInterface::ABSOLUTE_URL);
$url=$this->getParameter("oauthLoginurl")."?client_id=".$this->getParameter("oauthClientid")."&redirect_uri=".$callback."&response_type=code&state=STATE&scope=openid"; $url=$this->getParameter("oauthLoginurl")."?client_id=".$this->getParameter("oauthClientid")."&redirect_uri=".$callback."&response_type=code&state=12345678&scope=openid";
return $this->redirect($url); return $this->redirect($url);
} }
@ -226,6 +226,13 @@ class SecurityController extends AbstractController
"client_secret" => $this->getParameter("oauthClientsecret"), "client_secret" => $this->getParameter("oauthClientsecret"),
]; ];
$response=$this->apiservice->run("POST",$apiurl,$query); $response=$this->apiservice->run("POST",$apiurl,$query);
dump($response);
return $this->render('Home/home.html.twig',[
"useheader"=>true,
"usemenu"=>true,
"usesidebar"=>false,
"maxsize"=>1000,
]);
if(!$response||$response->code!="200") return $this->logout($request); if(!$response||$response->code!="200") return $this->logout($request);
$token=$response->body->access_token; $token=$response->body->access_token;
@ -340,7 +347,7 @@ class SecurityController extends AbstractController
$url=$this->getParameter("oauthLogouturl"); $url=$this->getParameter("oauthLogouturl");
if($url) { if($url) {
$url.="?id_token_hint=$token&state=openid&post_logout_redirect_uri=http://127.0.0.1:8000"; $url.="?id_token_hint=$token&scope=openid&post_logout_redirect_uri=http://127.0.0.1:8000";
return $this->redirect($url); return $this->redirect($url);
} else return $this->redirect($this->generateUrl("app_home")); } else return $this->redirect($this->generateUrl("app_home"));
} }