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

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

poofe/yii2-cas-client
=====================

CAS authentication for Yii2

1.0.0(7y ago)2193[2 PRs](https://github.com/poofe/yii2-cas-client/pulls)MITPHPPHP &gt;=5.4.0

Since Jul 25Pushed 6y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

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

[](#yii2-auth-cas)

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

Usage
-----

[](#usage)

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

    ```
    return [
        ...
        'session' => [
            'class' => 'poofe\yii2casclient\cas\Session',
            ...
        ],
        'modules' => [
            'cas' => [
                'class' => 'poofe\yii2casclient\cas\CasModule',
                'config' => [
                    'host' => 'ssoserver.example.com',
                    'port' => '443',
                    'path' => '/idp/profile/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' => [ ... ] ]`.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

2849d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/51bb8ab391a2928b382f829d21857d6860063e7f261fda970a4590370c3a34bf?d=identicon)[Jonas-Huang](/maintainers/Jonas-Huang)

---

Top Contributors

[![poofe](https://avatars.githubusercontent.com/u/18062968?v=4)](https://github.com/poofe "poofe (11 commits)")

---

Tags

Authenticationcasyii2yii

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/poofe-yii2-cas-client/health.svg)](https://phpackages.com/packages/poofe-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)
