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

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

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

monkeydp/laravel-cas

Composer 安装命令:

composer require monkeydp/laravel-cas

包简介

Simple CAS Authentication for Laravel 5.5

README 文档

README

Based on https://github.com/apereo/phpCAS

About

Simple CAS Authentication for Laravel 5.5

Features

  • Single Sign On
  • Single Logout

Requirement

  • Laravel >= 5.5

Installation

Require the monkeydp/laravel-cas package in your composer.json:

$ composer require monkeydp/laravel-cas

Configuration

The defaults are set in config/cas.php. Copy this file to your own config directory to modify the values. You can publish the config using this command:

$ php artisan vendor:publish --provider="Monkeydp\Cas\ServiceProvider"

This command not working in cmd

In your .env, configuration is as follows

CAS_SERVER_VERSION=3.0
CAS_SERVER_HOST=your.cas-server.host
CAS_SERVER_PORT=443

# Keep empty if cas-server in root
CAS_SERVER_URI=/path/to/cas-server

# Keep empty if the cert is homemade
CAS_SERVER_CA_CERT=/path/to/cert

# An array of host names allowed to send logout requests, separated by ","
CAS_ALLOWED_CLIENTS=192.168.10.114,192.168.20.10

# The url you want to redirect to after logout
CAS_LOGOUT_REDIRECT_TO=http://your.project.host

Register Route Middleware

If you want to allow CAS on a specific route, add the HandleCas middleware to $routeMiddleware in app/Http/Kernel.php:

    protected $routeMiddleware = [
        // ...
        'cas' => \Monkeydp\Cas\HandleCas::class,
    ];

Example

Single sign on

In routes/web.php, use cas middleware for any route has to login:

Route::group(['middleware' => 'cas'], function () {

    Route::get('/home', function(){
        return 'HOME';
    });
});

When you access http://your.project.host/home, the browser will redirect to Login Page of cas-server

Single Logout

Just access http://your.project.host/cas/logout

Use Get request

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固