Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tyler36/social-auth
https://github.com/tyler36/social-auth
laravel laravel-package oauth
Last synced: about 5 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/tyler36/social-auth
- Owner: tyler36
- License: mit
- Created: 2018-05-28T06:04:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-25T00:36:31.000Z (over 1 year ago)
- Last Synced: 2024-04-18T06:27:51.583Z (6 months ago)
- Topics: laravel, laravel-package, oauth
- Language: PHP
- Homepage:
- Size: 299 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Introduction
A simple package to add authentication via Socialite## User Flow
Route: ```login.sns```
- Validate provider
- Send user to provider (expects callback)Route: ```login.sns.callback```
- Validate provider
- Create / Update User
- Login if valid## Setup
- Install package
```
composer require tyler36/social-auth
```- Publish assets
```
php artisan vendor:publish --provider=Tyler36\SocialAuth\SocialAuthServiceProvider
```- Run migration
```
php artisan migrate
```- Add social-auth routes to ```./routes/web.php```
```
require __DIR__.'/socialauth.php';
```- Adding providers.
Create API key information for each provider you would like to you. Each provider requires a ```client_id```, ```client_secret```, & ```client_callback_url```.
A selection of some providers API website can be found in ```resources/lang/vendor/en/message.php``` file.- Update the services config file
For security, it is recommended to add this to your ```ENV`` file, then add/update the section in you ```config/services.php``` file.
EG.:
```
'github' => [
'client_id' => env('GITHUB_CLIENT_ID'),
'client_secret' => env('GITHUB_CLIENT_SECRET'),
'redirect' => env('GITHUB_CALLBACK_URL'),
],
```- Update the package config file
You will also need to add an entry into the ```config/socialauth``` file before this package recognizes the provider as valid.
EG.:
```
'github' => true
```- Update factories.
If you use model factories, you should update them## Testing
There are some (basic) tests.
```
phpunit .\vendor\tyler36\social-auth\tests
```