liyunde / laravel5-multi-cas by liyunde
forked from XavRsl/Cas

Multi CAS server SSO authentication for Laravel 5
Package Data
Maintainer Username: liyunde
Maintainer Contact: (Xavier Roussel)
Package Create Date: 2016-12-09
Package Last Update: 2016-12-12
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2023-05-28 03:00:33
Package Statistics
Total Downloads: 30
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0


[![Latest Version on Packagist][ico-version]][link-packagist] ![Software License][ico-license] [![Build Status][ico-travis]][link-travis] [![Total Downloads][ico-downloads]][link-downloads]

Multi CAS server SSO authentication in Laravel 5.x

this version base on xavrsl/cas v1.2.5 Compatible with the original version usage,thank author.

this version only use on multi diffent domain cas server in same project


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

For Laravel 5:

composer require liyunde/laravel5-multi-cas

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

For Laravel 5:



As well as the Facade :

	'Cas'       => MultiCas\Facades\Cas::class,

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

For Laravel 5 :

    $ php artisan vendor:publish


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 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.


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


Then get the current user id this way :