2017 © Pedro Peláez
 

library social-auth

Social Authentication

image

tyler36/social-auth

Social Authentication

  • Monday, May 28, 2018
  • by tyler36
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 167 % Grown

The README.md

Introduction

A simple package to add authentication via Socialite, (*1)

User Flow

Route: login.sns - Validate provider - Send user to provider (expects callback), (*2)

Route: login.sns.callback - Validate provider - Create / Update User - Login if valid, (*3)

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., (*4)

  • Update the services config file For security, it is recommended to add this to your ENV`` file, then add/update the section in youconfig/services.php``` file. EG.:, (*5)

    '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., (*6)

phpunit .\vendor\tyler36\social-auth\tests

The Versions

28/05 2018

dev-master

9999999-dev

Social Authentication

  Sources   Download

The Requires