PHP code example of dfoxx / laravel-shibboleth

1. Go to this page and download the library: Download dfoxx/laravel-shibboleth library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dfoxx / laravel-shibboleth example snippets


use Dfoxx\Shibboleth\HasShibbolethIdentifier;

class User extends Authenticatable
{
    use HasShibbolethIdentifier;
}

// unprotected routes

Route::middleware(['shibboleth'])->group(function () {
    // protected routes
});

'guards' => [
    'shibboleth' => [
        'driver' => 'shibboleth-session',
        'provider' => 'shibboleth',
    ],
],

// unprotected routes

Route::middleware(['auth:shibboleth'])->group(function () {
    // protected routes
});

use Dfoxx\Shibboleth\HasShibbolethData;

class User extends Authenticatable
{
    use HasShibbolethData;
}

$user->shib('eppn');
$user->shibboleth->data['eppn'];
bash
php artisan vendor:publish --tag=laravel-shibboleth-migrations
bash
php artisan vendor:publish --tag=laravel-shibboleth-config