PHPackages                             daxslab/yii2-cas-client - 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. daxslab/yii2-cas-client

ActiveYii2-extension[Authentication &amp; Authorization](/categories/authentication)

daxslab/yii2-cas-client
=======================

CAS authentication for Yii2

1.0.0(7y ago)3541MITPHPPHP &gt;=5.4.0

Since Jul 25Pushed 6y ago2 watchersCompare

[ Source](https://github.com/daxslab/yii2-cas-client)[ Packagist](https://packagist.org/packages/daxslab/yii2-cas-client)[ RSS](/packages/daxslab-yii2-cas-client/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (2)Used By (0)

yii2-auth-cas
=============

[](#yii2-auth-cas)

Yii2 library for authentication and user local record update by CAS, using the library [phpCAS](https://wiki.jasig.org/display/CASC/phpCAS).

Usage
-----

[](#usage)

1. Add this to the project with `composer require daxslab/yii2casclient`
2. Configure the Yii2 application, e.g. in `backend/config/main.php` :

    ```
    return [
        ...
        'session' => [
            'class' => 'poofe\yii2casclient\cas\Session',
            ...
        ],
        'modules' => [
            'cas' => [
                'class' => \daxslab\yii2casclient\cas\CasModule::class,
                'profileClass' => \common\models\Profile::class,
                'userClass' => \common\models\User::class,
                'config' => [
                'host' => '192.168.0.113',
                'port' => '8000',
                'path' => 'rrhh/default/user/cas',
                // optional parameters
                'certfile' => false, // empty, or path to a SSL cert, or false to ignore certs
                'debug' => true, // will add many logs into X/runtime/logs/cas.log
                ],
            ],

    ```
3. Add actions that use this CAS module, e.g. in `SiteController` :

    ```
    public function actionLogin()
    {
        if (!Yii::$app->user->isGuest) {
            return $this->goHome();
        }
        return $this->redirect(['/cas/auth/login']);
    }

    public function actionLogout()
    {
        if (Yii::$app->user->isGuest) {
            return $this->redirect(['/cas/auth/logout']);
        }
        return $this->goHome();
    }

    ```

Notes
-----

[](#notes)

The `user` component that implements `yii\web\IdentityInterface`will be used to fetch the local profile after querying the CAS server. It means that if `User` is the App component and CAS returns a username of "bibendum", the authentication will be successful if and only if the result of `User::findIdentity("bibendum")` is not null.

The action path '/cas/auth/login' starts with the alias of the module, as defined in the application configuration, e.g. `'cas'` in `'modules' => [ 'cas' => [ ... ] ]`.

The `profileClass` and `userClass` config parameters are used to update the profile and user table. The update proccess is based on the common attributes between the CAS server and the local tables profile and user.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.5% 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

Unknown

Total

1

Last Release

2848d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6706d701a64b46a4d77d03663942f6b5a8b639ba7f55055517afc082c6e4aa3e?d=identicon)[danielrodcaball](/maintainers/danielrodcaball)

---

Top Contributors

[![cccaballero](https://avatars.githubusercontent.com/u/3727802?v=4)](https://github.com/cccaballero "cccaballero (5 commits)")[![danielrodcaball](https://avatars.githubusercontent.com/u/24326932?v=4)](https://github.com/danielrodcaball "danielrodcaball (3 commits)")

---

Tags

Authenticationcasyii2yii

### Embed Badge

![Health badge](/badges/daxslab-yii2-cas-client/health.svg)

```
[![Health](https://phpackages.com/badges/daxslab-yii2-cas-client/health.svg)](https://phpackages.com/packages/daxslab-yii2-cas-client)
```

###  Alternatives

[amnah/yii2-user

Yii 2 user authentication module

252225.7k3](/packages/amnah-yii2-user)[nodge/yii2-eauth

Yii2 EAuth Extension. EAuth allows to authenticate users with accounts on other websites (Google, Facebook, Twitter, etc).

19399.4k](/packages/nodge-yii2-eauth)

PHPackages © 2026

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