PHPackages                             xavrsl/cas - 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. xavrsl/cas

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

xavrsl/cas
==========

Add CAS server SSO authentication to Laravel 4 and 5

v1.2.6(9y ago)7637.2k36[8 issues](https://github.com/XavRsl/Cas/issues)[3 PRs](https://github.com/XavRsl/Cas/pulls)MITPHPPHP &gt;=5.3.0

Since Jun 12Pushed 5y ago7 watchersCompare

[ Source](https://github.com/XavRsl/Cas)[ Packagist](https://packagist.org/packages/xavrsl/cas)[ RSS](/packages/xavrsl-cas/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (2)Versions (15)Used By (0)

CAS
===

[](#cas)

CAS server SSO authentication in Laravel 4.x &amp; 5.x

Installation
------------

[](#installation)

Require this package in your composer.json and run composer update.

For Laravel 4 use v1.1.\* :

```
"xavrsl/cas": "1.1.*"

```

For Laravel 5 use v1.2.\* :

```
"xavrsl/cas": "1.2.*"

```

After updating composer, add the ServiceProvider to the providers array:

For Laravel 4:

app/config/app.php

```
    'Xavrsl\Cas\CasServiceProvider',
```

As well as the Facade :

```
	'Cas' => 'Xavrsl\Cas\Facades\Cas',
```

For Laravel 5:

config/app.php

```
    Xavrsl\Cas\CasServiceProvider::class,
```

As well as the Facade :

```
	'Cas'       => Xavrsl\Cas\Facades\Cas::class,
```

Then publish the package's config using one of those methods :

For Laravel 4 :

```
    $ php artisan config:publish xavrsl/cas

```

For Laravel 5 :

```
    $ php artisan vendor:publish

```

Configuration
=============

[](#configuration)

Configuration should be pretty straightforward for anyone who's ever used the phpCAS client. Using the .env file will allow you to have different environments without even touching the cas.php config file. I've added the possibility to easily turn your application into a CAS Proxy, a CAS Service or both. You only need to set the cas\_proxy setting to true (if you need to proxy services) and set the cas\_service to whatever proxy you want to allow (this is all explained in the config file).

A new config variable (cas\_pretend\_user) available in the 1.2 release allows you to pretend to be a selected CAS user. The idea came with the usage of laravel homestead. My application was running on a private network, on a fake domain. The CAS server was not able to redirect to that application. So activating the CAS plugin on that application was not possible, but I needed a user id to query my LDAP and allow/disallow the user in my application. You only need to give it a user id and the application will act just as if you ware logged in with that CAS user.

Usage
=====

[](#usage)

Authenticate against the CAS server. This should be called before trying to retrieve the CAS user id.

```
	Cas::authenticate();
```

Then get the current user id this way :

```
	Cas::getCurrentUser();
```

OR

```
  Cas::user();
```

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~87 days

Recently: every ~63 days

Total

12

Last Release

3442d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1185840?v=4)[Xavier Roussel](/maintainers/XavRsl)[@XavRsl](https://github.com/XavRsl)

---

Top Contributors

[![XavRsl](https://avatars.githubusercontent.com/u/1185840?v=4)](https://github.com/XavRsl "XavRsl (26 commits)")[![umt-dev-123](https://avatars.githubusercontent.com/u/136470301?v=4)](https://github.com/umt-dev-123 "umt-dev-123 (4 commits)")[![andremuller](https://avatars.githubusercontent.com/u/110772?v=4)](https://github.com/andremuller "andremuller (2 commits)")[![jmandrade](https://avatars.githubusercontent.com/u/1674999?v=4)](https://github.com/jmandrade "jmandrade (1 commits)")[![livebranch](https://avatars.githubusercontent.com/u/92565707?v=4)](https://github.com/livebranch "livebranch (1 commits)")[![loren138](https://avatars.githubusercontent.com/u/1224505?v=4)](https://github.com/loren138 "loren138 (1 commits)")[![pies](https://avatars.githubusercontent.com/u/37940?v=4)](https://github.com/pies "pies (1 commits)")[![samyerkes](https://avatars.githubusercontent.com/u/1301322?v=4)](https://github.com/samyerkes "samyerkes (1 commits)")[![gpspake](https://avatars.githubusercontent.com/u/3385690?v=4)](https://github.com/gpspake "gpspake (1 commits)")[![fancyoung](https://avatars.githubusercontent.com/u/243587?v=4)](https://github.com/fancyoung "fancyoung (1 commits)")

---

Tags

laravelSSOcasphpCAS

### Embed Badge

![Health badge](/badges/xavrsl-cas/health.svg)

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

###  Alternatives

[directorytree/ldaprecord-laravel

LDAP Authentication &amp; Management for Laravel.

5752.3M18](/packages/directorytree-ldaprecord-laravel)

PHPackages © 2026

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