承接 csi-uksw/laravel-cas 相关项目开发

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

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

csi-uksw/laravel-cas

Composer 安装命令:

composer require csi-uksw/laravel-cas

包简介

UKSW CAS auth module for Laravel 5.1

README 文档

README

Versions

Version 1.0 requires PHP 5.5.9+.

Laravel 5.1

To install this package pull it in through Composer.

composer require csi-uksw/laravel-cas

After Composer is done, you need to tell your application to use the CAS service provider.

Open config/app.php and add the service provider

CSI_UKSW\Laravel\CAS\CASServiceProvider::class

after

Illuminate\Auth\AuthServiceProvider::class

As well the Facade :

'CAS' => CSI_UKSW\Laravel\CAS\Facades\CAS::class

Configuration

Basic

To set up your CAS for connections you have to publish CAS config. This will provide all the configuration values for your connection.

php artisan vendor:publish --provider="CSI_UKSW\Laravel\CAS\CASServiceProvider"

After that please edit your app/cas.php. Using the .env file will allow you to have different environments without even touching the app/cas.php config file.

Middleware

Optionally you can use provided Auth Middleware.

After publishing please edit your app/Http/Kernel.php

protected $routeMiddleware = [
    'auth.cas' => \CSI_UKSW\Laravel\CAS\Http\Middleware\CASAuthMiddleware::class
];

Usage

Authenticate:

CAS::authenticate()

Logout:

CAS::logout()

Get username:

CAS::getUser()

Get user attributes:

CAS::getAttributes()

Check if is authenticated:

CAS::isAuthenticated()

Route middleware:

Route::group(['middleware' => 'auth.cas'], function () {
   get('cas', function(){
       echo 'authorized only';
   });
});

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固