Skip to content

Log users into your application using our centralised authentification application at auth.trustup.io

License

Notifications You must be signed in to change notification settings

deegitalbe/laravel-trustup-io-authentification

Repository files navigation

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.

About

Log users into your application using our centralised authentification application at auth.trustup.io

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages