fourcms / auth
Auth package for fourcms
Requires
- php: >=5.5.9
- guzzlehttp/guzzle: ~6.2
- laravel/framework: 5.1.*|5.2.*|5.3.*|5.4.*
- longman/ip-tools: 1.0.*
- longman/laravel-platfourm: ~0.2.0
Requires (Dev)
- graham-campbell/testbench: ~3.1
- mockery/mockery: 0.9.*
- phpspec/phpspec: ~2.5
- phpunit/phpunit: ~4.8
- squizlabs/php_codesniffer: 2.6.*
This package is not auto-updated.
Last update: 2024-12-16 15:23:42 UTC
README
Table of Contents
Installation
Install this package through Composer.
Edit your project's composer.json
file to add custom repository and require platfourm/auth
Create composer.json file:
{ "name": "yourproject/yourproject", "type": "project", "require": { "platfourm/auth": "dev_master" }, "repositories": [ { "type": "composer", "url": "https://packagist.itdc.ge" } ] }
And run composer update
After updating composer, add the AuthServiceProvider to the providers array in config/app.php
Platfourm\Auth\AuthServiceProvider::class,
And add Platfourm\Auth\RemoteUserTrait to your user model.
After in config/auth.php add new guard in guards section
'itdc' => [ 'driver' => 'session', 'provider' => 'itdc', ],
And add provider in providers section
'itdc' => [ 'driver' => 'itdc', // Driver name 'model' => App\User::class, // User model class 'endpoint' => 'https://service.itdc.ge/api7', // Authorization service endpoint 'check_ip' => true, // Check allowed or not authorization on service from user's ip 'auto_save' => true, // Save remote user in local database on success login. On false will be used cache storage 'attach_role' => '', // If you are using Entrust Permissions package, provide default role for remote user ],
After you can change default guard in config/auth.php to itdc:
'defaults' => [ 'guard' => 'itdc', 'passwords' => 'users', ],
Usage
You must add application APP_KEY to ITDC Auth servers for authentication
TODO
write tests
Troubleshooting
Please report any bugs you find on the issues page.
Contributing
Pull requests are welcome. See CONTRIBUTING.md for information.
License
Please see the LICENSE included in this repository for a full copy of the proprietary license, which this project is licensed under.