deegitalbe/laravel-trustup-io-authentification

Connect your Laravel project to our centralized authentication service


README

68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f737570706f72742d756b7261696e652e7376673f743d31

Connect your Laravel project to our centralized authentication service

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Installation

Require package

composer require deegitalbe/laravel-trustup-io-authentification

Publish config

php artisan vendor:publish --tag="trustup-io-authentification-config"

This will publish trustup-io-authentification.php in config folder

Define roles

You should define roles that have access in config file trustup-io-authentification.php.

'roles' => [
    'Super Admin',
    'Employee',
    'Translator'
],

Define guards

In config file auth.php redefine your guards

'guards' => [
    'web' => [
        'driver' => 'session',
        'provider' => 'users',
        'driver' => 'trustup.io',
    ],
    'api' =>[
        'driver' => 'trustup.io'
    ]
],

Activate docker

In case your application is using docker-integration, define this env variable

TRUSTUP_IO_AUTH_DOCKER_ACTIVATED=true

Add middleware to protect your restricted routes

use Illuminate\Support\Facades\Route;
use Deegitalbe\LaravelTrustupIoAuthentification\Http\Middleware\TrustUpIoAuthMiddleware;

Route::middleware(TrustUpIoAuthMiddleware::class)->group(function() {
    // Your restricted routes ...
});

Route::middleware(TrustUpIoAuthMiddleware::class.':Super Admin|Translator')->group(function() {
    // Your restricted routes only accessible by super admins or translators ...
});

Docker compatibility

Update package to latest version

composer require deegitalbe/laravel-trustup-io-authentification

Force config publication and set correct values (model, roles, guard, ...)

php artisan vendor:publish --tag="trustup-io-authentification-config" --force

Define env variable

TRUSTUP_IO_AUTH_DOCKER_ACTIVATED=true

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.