clemsonmartech/laravel-shibboleth 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

clemsonmartech/laravel-shibboleth

最新稳定版本:v1.03

Composer 安装命令:

composer require clemsonmartech/laravel-shibboleth

包简介

Fork of razorbacks/laravel-shibboleth in order to support modern Laravel

README 文档

README

This package provides Shibboleth authentication for Laravel. It was forked from razorbacks/laravel-shibboleth.

For development, it can emulate an IdP (via mrclay/shibalike).

Build Status Code Climate Code Coverage

Installation

Use composer to require the latest release into your project:

composer require clemsonmartech/laravel-shibboleth

If you you would like to use the emulated IdP via shibalike, then you will need to manually register it on any version - this is not automatically loaded.

Jhu\Wse\LaravelShibboleth\ShibalikeServiceProvider::class,

Note that the password is the same as the username for shibalike.

Publish the default configuration file:

php artisan vendor:publish --provider="Jhu\Wse\LaravelShibboleth\ShibbolethServiceProvider"

Optionally, you can also publish the views for the shibalike emulated IdP login:

php artisan vendor:publish --provider="Jhu\Wse\LaravelShibboleth\ShibalikeServiceProvider"

Change the driver to shibboleth in your config/auth.php file.

'providers' => [
    'users' => [
        'driver' => 'shibboleth',
        'model'  => App\Models\User::class,
    ],
],

Now users may login via Shibboleth by going to https://example.com/shibboleth-login and logout using https://example.com/shibboleth-logout so you can provide a custom link or redirect based on email address in the login form.

@if (Auth::guest())
    <a href="/shibboleth-login">Login</a>
@else
    <a href="/shibboleth-logout">
        Logout {{ Auth::user()->name }}
    </a>
@endif

You may configure server variable mappings in config/shibboleth.php such as the user's first name, last name, entitlements, etc. You can take a look at them by reading what's been populated into the $_SERVER variable after authentication.

<?php print_r($_SERVER);

If the config setting shibboleth.update_users is set to true (the default) then mapped values will be synced to the user table upon successful authentication. To disable updated, set shibboleth.update_users to false.

Authorization

You can check for an entitlement string of the current user statically:

$entitlement = 'urn:mace:uark.edu:ADGroups:Computing Services:Something';

if (Entitlement::has($entitlement)) {
    // authorize something
}

Now you can draft policies and gates around these entitlements.

JWTAuth Tokens

If you're taking advantage of token authentication with tymon/jwt-auth then set this variable in your .env

JWTAUTH=true

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-04-25