承接 jyj1993126/cas 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jyj1993126/cas

Composer 安装命令:

composer require jyj1993126/cas

包简介

Add CAS server SSO authentication to Laravel 4 and 5

README 文档

README

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:

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

统计信息

  • 总下载量: 31
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 36
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固