Commit 44e6043b authored by David Surville's avatar David Surville
Browse files

Merge branch 'master' into auth_migration

parents 67ffd211 ad1c9eed
Loading
Loading
Loading
Loading
+17 −1
Changes for CHANGELOG.md: 17 added lines, 1 removed line.
Original line number Diff line number Diff line
# Changelog
# CHANGELOG

## 1.0.1 (07/02/2022)

- Ajout d'un paramètre "form_skip" qui permet de sauter la page d'authentification "/auth/connexion" si on utilise qu'une seule source d'authentification (pas utilisable pour une authentificatin locale).
- [Fix] La déconnexion du CAS n'était pas effective lors de la déconnexion de l'application

## 1.0.0 (02/02/2022)

- Scission du module UnicaenAuth en trois modules :
  - UnicaenAuthentification
  - UnicaenUtilisateur
  - UnicaenPrivilege

---

## UnicaenAuth (deprecated)

## 1.3.0 - 23/01/2019

+13 −0
Changes for config/module.config.php: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -102,6 +102,11 @@ $settings = [
         */
        'form' => CasLoginForm::class,

        /**
         * Permet de sauter le formulaire d'authentification "/auth/connexion" si CAS est la seule source d'authentification
         */
        'form_skip' => false,

        /**
         * Infos de connexion au serveur CAS.
         */
@@ -128,6 +133,9 @@ $settings = [

        'form' => LoginForm::class,

        /** /!\ Pas modifiable dans la conf local */
        'form_skip' => false,

        /**
         * Mode d'authentification à l'aide d'un compte dans la BDD de l'application.
         */
@@ -157,6 +165,11 @@ $settings = [
        'adapter' => Shib::class,
        'form' => ShibLoginForm::class,

        /**
         * Permet de sauter le formulaire d'authentification "/auth/connexion" si Shibboleth est la seule source d'authentification
         */
        'form_skip' => false,

        /**
         * URL de déconnexion.
         */
+2 −2
Changes for src/UnicaenAuthentification/Authentication/Adapter/Cas.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -133,13 +133,13 @@ class Cas extends AbstractAdapter
     */
    public function logout(EventInterface $e)
    {
        parent::logout($e);

        $storage = $this->getStorage()->read();
        if (! isset($storage['identity'])) {
            return;
        }

        parent::logout($e);

        $returnUrl = $this->router->getRequestUri()->setPath($this->router->getBaseUrl())->toString();
        $this->getCasClient()->logoutWithRedirectService($returnUrl);
    }
+2 −2
Changes for src/UnicaenAuthentification/Authentication/Adapter/Shib.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -137,13 +137,13 @@ class Shib extends AbstractAdapter
     */
    public function logout(EventInterface $e)
    {
        parent::logout($e);

        $storage = $this->getStorage()->read();
        if (! isset($storage['identity'])) {
            return;
        }

        parent::logout($e);

        // désactivation de l'usurpation d'identité éventuelle
        $this->shibService->deactivateUsurpation();

+14 −1
Changes for src/UnicaenAuthentification/Controller/AuthController.php: 14 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -132,6 +132,19 @@ class AuthController extends AbstractActionController
            return $this->redirect()->toRoute(null, ['type' => $type], ['query' => $this->params()->fromQuery()], true);
        }

        $enabledAuthTypes = $this->moduleOptions->getEnabledAuthTypes();
        $authOptions = $this->moduleOptions->$type;

        /*
         * On saute (on va directement à authenticateAction()) le formulaire d'authentification "/auth/connexion" si :
         * - le type d'authentification utilisé est différent de 'local'
         * - un seul type d'authentification est activé dans la config (enabled = true)
         * - le paramètre "form_skip" est activé dans la config pour le type d'authentification utilisé (form_skip = true)
         */
        if($type != 'local' && count($enabledAuthTypes) === 1 && $authOptions['form_skip'] === true) {
            $this->redirect()->toRoute('zfcuser/authenticate', [], ['query' => $this->params()->fromQuery()], true);
        }

        $request = $this->getRequest();
        $form = $this->getLoginFormForType($type);
        $form->initFromRequest($request);
@@ -152,7 +165,7 @@ class AuthController extends AbstractActionController

        if (!$request->isPost()) {
            return array(
                'types' => $this->moduleOptions->getEnabledAuthTypes(),
                'types' => $enabledAuthTypes,
                'type' => $type,
                'loginForm' => $form,
                'forms' => $this->loginFormForType,
Loading