looxis/gate-connector

v3.0.0 2024-02-12 10:29 UTC

README

Latest Version on Packagist Build Status Quality Score Total Downloads

Gate Connector helps you to connect your oauth client to connect to your oauth server of choice via socialite. Your default Login automatically redirects to the oauth server.

Installation

You can install the package via composer:

composer require looxis/gate

Usage

Add some properties to your .env file (see .env.example)

GATE_ENABLED=true
GATE_URL="https://gate.example.com/"
GATE_CLIENT_ID=3
GATE_CLIENT_SECRET=client_secret

Publish and Run migration

php artisan vendor:publish --tag=gate-migrations
php artisan migrate

Add gate_id and api_token to fillable array in User model.

Also you can change auth callback route and controller in config or in .env file

GATE_AUTH_CALLBACK_URI="auth/callback"
GATE_AUTH_CALLBACK_CONTROLLER="App\\Http\\Controllers\\Auth\\LoginController"

Change use AuthenticatesUsers statement in App\Http\Controllers\Auth\LoginController or any other login controller you want to use with Looxis Gate.

use AuthenticatesUsers, LoginControllerTrait {
        LoginControllerTrait::loggedOut insteadof AuthenticatesUsers;
        LoginControllerTrait::showLoginForm insteadof AuthenticatesUsers;
    }

loggedOut should be called from logout method of this controller (if you override it).

Also you can publish the config file with this artisan command:

php artisan vendor:publish --tag=gate-config

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email dev@looxis.com instead of using the issue tracker.

Credits

License

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

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.