GithubHelp home page GithubHelp logo

cas's Introduction

CAS

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

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 in app/config/app.php

    'Xavrsl\Cas\CasServiceProvider',

As well as the Facade :

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

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

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();

cas's People

Contributors

andremuller avatar fancyoung avatar gpspake avatar pies avatar samyerkes avatar umt-dev-123 avatar xavrsl avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.