PHPackages                             dsi-iepg/cas-connection - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. dsi-iepg/cas-connection

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

dsi-iepg/cas-connection
=======================

Mise en place d'une authentification par CAS

v2.1.1(4mo ago)0265↓100%MITPHPPHP &gt;=8.2

Since Jan 4Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/dsi-iepg/casBundle)[ Packagist](https://packagist.org/packages/dsi-iepg/cas-connection)[ Docs](https://github.com/dsi-iepg/cas-bundle)[ RSS](/packages/dsi-iepg-cas-connection/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (10)Used By (0)

Cas connection Bundle
=====================

[](#cas-connection-bundle)

The bundle make and authenicator with and phpCas based on the login of user. If you want multiple authenticator anser yes for `does need passwords => yes`.

[offical documentation](https://symfony.com/doc/current/security.html).

installation
------------

[](#installation)

The authenticator use 2 role:

- USER
- ADMIN

Applications that use Symfony Flex
----------------------------------

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
$ composer require dsi-iepg/cas-connection
```

---

Create `User` with `login`

```
$ php bin/console make:user
```

- name class =&gt; User
- store user data in the database =&gt; yes
- property name =&gt; login
- does need passwords =&gt; no

---

make and play migrations with Doctrine.

files modifications
-------------------

[](#files-modifications)

Add in `config/bundles.php`

```
    return [
      ...
        Iepg\Bundle\Cas\CasConnectionBundle::class => ['all' => true],
    ]

```

Add in `.env`

```
#.env
...
#### Parameters for CAS connection ###
CAS_HOST=cas-adresse.com
# This value is optional
# If it's empty the path will the base url"
# example: scheme://httpHost+BasePath"
CAS_PATH=
# Default value 443"
CAS_PORT=443
# This value is optional
# if it's 'false' you don't use ceretificat
# THIS SETTING IS NOT RECOMMENDED FOR PRODUCTION!
CAS_CA=false
# The path start to the DocumentRoot generaly public
# example if your file was at the root of project
# CAS_CA_PATH=../certificat
CAS_CA_PATH=
# this value is optional. You can custome the NAME of the dispatcher route
# Where does the user go according to his role
# The default value is 'cas_dispatcher'
CAS_DISPATCHER_NAME=
# this value is optional. YOU CAN CUSTOMIZE THE PAGE WHEN A USER IS SUCCESSFULLY AUTHENTICATED
# BUT DOES NOT HAVE ACCESS RIGHTS TO THIS APPLICATION
CAS_USER_UNKNOW=
#### end of Cas-connection ####
...

```

Add in `config/packages/security.yaml`

```
#config/packages/security.yaml
...
   firewalls:
      main:
         provider: app_user_provider
         custom_authenticator: Iepg\Bundle\Cas\Controller\CasAuthenticator
...

```

Or if you use multiple authenticators

```
#config/packages/security.yaml
   ...
   firewalls:
      main:
         ...
         #choose the first authenticator you want.
         entry_point: App\Security\AppAuthenticator
         custom_authenticator:
               - Iepg\Bundle\Cas\Controller\CasAuthenticator
               - App\Security\AppAuthenticator
         ...

```

And add

```
 access_control:
        - { path: ^/cas_, roles: IS_AUTHENTICATED_ANONYMOUSLY  }
        - ...

```

WARNING! For attention reasons, please avoid starting your own route with 'cas\_'

add Files
---------

[](#add-files)

Add file in `config/packages/cas_connection.yaml`

```
#config/packages/cas_connection.yaml
cas_connection:
    cas_host: "%env(CAS_HOST)%"
    cas_path: "%env(CAS_PATH)%"
    cas_port: "%env(int:CAS_PORT)%"
    cas_ca: "%env(bool:CAS_CA)%"
    cas_ca_path: "%env(CAS_CA_PATH)%"
    cas_dispatcher_name: "%env(CAS_DISPATCHER_NAME)%"

twig:
    paths:
        "%kernel.project_dir%/vendor/dsi-iepg/cas-connection/src/Resources/views": cas_connection

```

Add in file `config/routes.yaml`

```
#config/routes/cas_connection.yaml
cas_login:
    path: /cas_login
    controller: Iepg\Bundle\Cas\Controller\CasAuthenticator

cas_logout:
    path: /cas_logout

cas_dispatcher:
    path: /cas_dispatcher
    controller: Iepg\Bundle\Cas\Controller\CasController::dispatcher
```

Add file in `src/EventListener/logoutSubcriber.php`

```
//src/EventListener/logoutSubcriber.php
namespace App\EventListener;

use Iepg\Bundle\Cas\Controller\CasLogout;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Http\Event\LogoutEvent;

class LogoutSubscriber implements EventSubscriberInterface
{
    private $casLogout;

    public function __construct(CasLogout $casLogout)
    {
        $this->casLogout = $casLogout;
    }

    public static function getSubscribedEvents(): array
    {
        return [LogoutEvent::class => 'onLogout'];
    }

    public function onLogout(LogoutEvent $event): void
    {

        $this->casLogout->logout($event->getRequest());

    }
}
```

###  Health Score

44

—

FairBetter than 91% of packages

Maintenance79

Regular maintenance activity

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~153 days

Recently: every ~169 days

Total

8

Last Release

145d ago

Major Versions

v0.1 → v1.12023-12-15

v1.2 → V2.12025-12-12

PHP version history (2 changes)v0.1PHP &gt;=7.2.5

V2PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/872dfe6e5998ae13b8b5e7b2e5aa0e5dcd240abf2767123f8b914730ab823303?d=identicon)[dsi-iepg](/maintainers/dsi-iepg)

---

Top Contributors

[![dsi-iepg](https://avatars.githubusercontent.com/u/119951464?v=4)](https://github.com/dsi-iepg "dsi-iepg (43 commits)")

---

Tags

cascasphpiepg

### Embed Badge

![Health badge](/badges/dsi-iepg-cas-connection/health.svg)

```
[![Health](https://phpackages.com/badges/dsi-iepg-cas-connection/health.svg)](https://phpackages.com/packages/dsi-iepg-cas-connection)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M309](/packages/easycorp-easyadmin-bundle)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M192](/packages/simplesamlphp-simplesamlphp)[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[scheb/2fa-bundle

A generic interface to implement two-factor authentication in Symfony applications

6914.0M61](/packages/scheb-2fa-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
