承接 mnshankar/laravel-shib-auth 相关项目开发

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

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

mnshankar/laravel-shib-auth

Composer 安装命令:

composer require mnshankar/laravel-shib-auth

包简介

Convert Shibboleth tokens to equivalent Laravel User Table columns so Laravel auth semantics can be used

README 文档

README

Shibboleth authentication typically results in the identity provider setting a bunch of server variables after successful authentication. This is a Laravel 5.0+/PHP 5.4+ package helps with converting those server tokens into Laravel User Table fields so that regular Laravel semantics of authentication can be followed.

Note that shib auth must already have occured - usually using directives in the .htaccess file.

The included middleware checks the user table and

  1. If a matching user is NOT found, it creates a new user row
  2. If a user is found in the users table, the corresponding user record is retrieved
  3. The user is then logged in to the application using Auth::login($user)

Installation

require the package via composer

$ composer require mnshankar/laravel-shib-auth

Next, setup the service provider. This allows you to modify the config file (the default tokens are specific to UF implementation of Shibboleth)

In your config/app providers array, add:

'mnshankar\Shib\ShibAuthServiceProvider',

You must insure that

  1. The mapped fields exist in your users table.
  2. Shibboleth sets valid values for all tokens specified (else exception is thrown)
  3. "password" field in the users table must be nullable as we will not be using it.

Usage

Edit your http kernel.php file to include the shib middleware from the package like so:

'shib'=>'mnshankar\Shib\Middleware\ShibAuth',

Now, you can use the middleware either from the controller or from your route.

  1. In your controller:

    function __construct()
    {
        $this->middleware('shib');
    }
  2. In your route:

    Using Laravel 5.0

    Route::get('my/page', ['middleware' => 'shib', function()
    {
        //
    }]);

    Using Laravel 5.1+

    You can continue using Laravel 5.0 style.. or use chaining:

    Route::get('/', function () {
        //
    })->middleware(['shib']);

    You may also use route groups. Please look up Laravel documentation on Middleware to learn more https://laravel.com/docs/5.2/middleware

Configuration Options

You can customize the configuration options by publishing them

php artisan vendor:publish --provider="mnshankar\Shib\ShibAuthServiceProvider"

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固