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

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

jyj1993126/cas
==============

Add CAS server SSO authentication to Laravel 4 and 5

5.0(10y ago)031MITPHPPHP &gt;=5.3.0

Since Jun 12Pushed 9y agoCompare

[ Source](https://github.com/jyj1993126/Cas)[ Packagist](https://packagist.org/packages/jyj1993126/cas)[ RSS](/packages/jyj1993126-cas/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (2)Versions (11)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

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 65.8% 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 ~98 days

Recently: every ~157 days

Total

8

Last Release

3703d ago

Major Versions

v1.2.1 → 5.02016-05-04

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6315451?v=4)[Leon J](/maintainers/jyj1993126)[@jyj1993126](https://github.com/jyj1993126)

---

Top Contributors

[![XavRsl](https://avatars.githubusercontent.com/u/1185840?v=4)](https://github.com/XavRsl "XavRsl (25 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)")[![jyj1993126](https://avatars.githubusercontent.com/u/6315451?v=4)](https://github.com/jyj1993126 "jyj1993126 (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/jyj1993126-cas/health.svg)

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

###  Alternatives

[xavrsl/cas

Add CAS server SSO authentication to Laravel 4 and 5

7637.1k](/packages/xavrsl-cas)

PHPackages © 2026

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