2017 © Pedro Peláez
 

library manager

Easily add new or override built-in providers in Laravel Socialite.

image

raymondwilkinson/manager

Easily add new or override built-in providers in Laravel Socialite.

  • Thursday, June 22, 2017
  • by RaymondWilkinson
  • Repository
  • 1 Watchers
  • 0 Stars
  • 124 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 43 Forks
  • 0 Open issues
  • 36 Versions
  • 0 % Grown

The README.md

Socialite Providers Manager

Build Status Code Coverage Scrutinizer Code Quality Latest Stable Version Total Downloads Latest Unstable Version License Stories in Ready SensioLabsInsight, (*1)

About

A package for Laravel Socialite that allows you to easily add new providers or override current providers., (*2)

Benefits

  • You will have access to all of the providers that you load in using the manager.
  • Instantiation is deferred until Socialite is called
  • You can override current providers
  • You can create new providers
  • Lumen usage is easy
  • stateless() can be set to true or false
  • You can override a config dynamically
  • It retrieves environment variables directly from the .env file instead of also having to configure the services array.

Available Providers

Reference

Creating a Handler

Below is an example handler. You need to add this full class name to the listen[] in the EventServiceProvider., (*3)

namespace Your\Name\Space;

use SocialiteProviders\Manager\SocialiteWasCalled;

class ProviderNameExtendSocialite
{
    public function handle(SocialiteWasCalled $socialiteWasCalled)
    {
        $socialiteWasCalled->extendSocialite('providername', \Your\Name\Space\Provider::class);
    }
}

Creating a Provider

Overriding a Built-in Provider

You can easily override a built-in laravel/socialite provider by creating a new one with exactly the same name (i.e. 'facebook')., (*4)

Dynamically Passing a Config

You can dynamically pass a config by using:, (*5)

$clientId = "secret";
$clientSecret = "secret";
$redirectUrl = "http://yourdomain.com/api/redirect";
$additionalProviderConfig = ['site' => 'meta.stackoverflow.com'];
$config = new \SocialiteProviders\Manager\Config($clientId, $clientSecret, $redirectUrl, $additionalProviderConfig);
return Socialite::with('provider-name')->setConfig($config)->redirect();

You must call this before you run any Socialite methods., (*6)

Creating an OAuth1 Server Class

Take a look at the other OAuth1 providers for inspiration., (*7)

Getting the Access Token Response Body

Laravel Socialite by default only allows access to the access_token. Which can be accessed via the \Laravel\Socialite\User->token public property. Sometimes you need access to the whole response body which may contain items such as a refresh_token., (*8)

To make this possible, the OAuth2 provider class needs to extend \SocialiteProviders\Manager\OAuth2\AbstractProvider and OAuth1 providers need to utilize the \SocialiteProviders\Manager\OAuth1\AbstractProvider and \SocialiteProviders\Manager\OAuth1\Server., (*9)

You can access it from the user object like so: $user->accessTokenResponseBody, (*10)

The Versions

22/06 2017

dev-master

9999999-dev

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

22/06 2017

v3.0.0

3.0.0.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

21/06 2016

v2.2.2

2.2.2.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

20/06 2016

v2.2.1

2.2.1.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

20/06 2016

v2.2.0

2.2.0.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

18/06 2016

v2.1.4

2.1.4.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

03/06 2016

v2.1.3

2.1.3.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

27/05 2016

v2.1.2

2.1.2.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

21/04 2016

v2.1.1

2.1.1.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

12/04 2016

v2.1.0

2.1.0.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

07/04 2016

v2.0.2

2.0.2.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

06/04 2016

v2.0.1

2.0.1.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

29/03 2016

v2.0.0

2.0.0.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

29/03 2016

dev-develop

dev-develop

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

20/02 2016

1.2.4

1.2.4.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

18/01 2016

1.2.3

1.2.3.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

14/01 2016

1.2.2

1.2.2.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

14/01 2016

1.2.1

1.2.1.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

14/01 2016

1.2.0

1.2.0.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

13/01 2016

1.1.1

1.1.1.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

13/01 2016

1.1.0

1.1.0.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

08/01 2016

1.0.2

1.0.2.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

27/06 2015

1.0.1

1.0.1.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

18/06 2015

1.0.0

1.0.0.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

03/05 2015

2.0.x-dev

2.0.9999999.9999999-dev

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

03/05 2015

0.1.10

0.1.10.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

26/02 2015

0.1.9

0.1.9.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

26/02 2015

0.1.8

0.1.8.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

The Development Requires

21/02 2015

0.1.7

0.1.7.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

21/02 2015

0.1.6

0.1.6.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

21/02 2015

0.1.5

0.1.5.0

Easily add new or override built-in providers in Laravel Socialite.

  Sources   Download

MIT

The Requires

 

19/02 2015

0.1.4

0.1.4.0

An easy way to extend Laravel Socialite

  Sources   Download

MIT

The Requires

 

19/02 2015

0.1.3

0.1.3.0

An easy way to extend Laravel Socialite

  Sources   Download

MIT

The Requires

 

19/02 2015

0.1.2

0.1.2.0

An easy way to extend Laravel Socialite

  Sources   Download

MIT

The Requires

 

19/02 2015

0.1.1

0.1.1.0

An easy way to extend laravel/socialite

  Sources   Download

MIT

The Requires

 

19/02 2015

0.1

0.1.0.0

An easy way to extend laravel/socialite

  Sources   Download

MIT

The Requires