2017 © Pedro PelĂĄez
 

library passport-social-grant

Social guard for Laravel Passport

image

adaojunior/passport-social-grant

Social guard for Laravel Passport

  • Wednesday, May 16, 2018
  • by adaojunior
  • Repository
  • 5 Watchers
  • 77 Stars
  • 15,699 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 12 Forks
  • 2 Open issues
  • 14 Versions
  • 31 % Grown

The README.md

Social Grant for Laravel Passport

This package adds a social grant to your Oauth2 Server., (*1)

Installation

You can install the package via composer:, (*2)

composer require adaojunior/passport-social-grant

The package will automatically register its service provider. Or you may manually add the service provider in your config/app.php file:, (*3)

'providers' => [
    // ...
    Adaojunior\PassportSocialGrant\SocialGrantServiceProvider::class,
];

Setup

  1. Implement the SocialGrantUserProvider interface:
<?php

namespace App\SocialGrant;

use Laravel\Socialite\Facades\Socialite;
use Illuminate\Contracts\Auth\Authenticatable;
use League\OAuth2\Server\Entities\ClientEntityInterface;
use Adaojunior\PassportSocialGrant\SocialGrantUserProvider;

class UserProvider implements SocialGrantUserProvider
{
    /**
     * Retrieve a user by provider and access token.
     *
     * @param string $provider
     * @param string $accessToken
     * @param ClientEntityInterface $client
     * @return Authenticatable|null
     */
    public function getUserByAccessToken(string $provider, string $accessToken, ClientEntityInterface $client):? Authenticatable
    {

    }
}
  1. Bind SocialGrantUserProvider interface to your implementation in the register method of your application service provider app/Providers/AppServiceProvider.php:
$this->app->bind(
    Adaojunior\PassportSocialGrant\SocialGrantUserProvider::class,
    App\SocialGrant\UserProvider::class
);

Usage

$response = $http->post('http://your.app/oauth/token', [
    'form_params' => [
        'grant_type' => 'social',
        'client_id' => $clientId,
        'client_secret' => $clientSecret,
        'provider' => $providerName, // name of provider (e.g., 'facebook', 'google' etc.)
        'access_token' => $providerAccessToken, // access token issued by specified provider
    ],
]);

The Versions

16/05 2018

dev-master

9999999-dev https://github.com/adaojunior/passport-social-grant

Social guard for Laravel Passport

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel social oauth passport guard

28/04 2018

dev-passport-social-grant-v4

dev-passport-social-grant-v4 https://github.com/adaojunior/passport-social-grant

Social guard for Laravel Passport

  Sources   Download

MIT

The Requires

 

laravel social oauth passport guard

18/04 2018

v3.3

3.3.0.0 https://github.com/adaojunior/passport-social-grant

Social guard for Laravel Passport

  Sources   Download

MIT

The Requires

 

laravel social oauth passport guard

12/02 2018

v3.2

3.2.0.0 https://github.com/adaojunior/passport-social-grant

Social guard for Laravel Passport

  Sources   Download

MIT

The Requires

 

laravel social oauth passport guard

01/09 2017

v3.1

3.1.0.0 https://github.com/adaojunior/passport-social-grant

Social guard for Laravel Passport

  Sources   Download

MIT

The Requires

 

laravel social oauth passport guard

16/07 2017

v3.0

3.0.0.0 https://github.com/adaojunior/passport-social-grant

Social guard for Laravel Passport

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel social oauth passport guard

17/03 2017

v2.0

2.0.0.0 https://github.com/adaojunior/passport-social-grant

Social guard for Laravel Passport

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel social oauth passport guard

10/03 2017

dev-passport-2.0

dev-passport-2.0 https://github.com/adaojunior/passport-social-grant

Social guard for Laravel Passport

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel social oauth passport guard

10/03 2017

v2.0-beta.1

2.0.0.0-beta1 https://github.com/adaojunior/passport-social-grant

Social guard for Laravel Passport

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel social oauth passport guard

10/03 2017

v2.0-beta.0

2.0.0.0-beta0 https://github.com/adaojunior/passport-social-grant

Social guard for Laravel Passport

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel social oauth passport guard

10/03 2017

dev-passport-1.0

dev-passport-1.0 https://github.com/adaojunior/passport-social-grant

Social guard for Laravel Passport

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel social oauth passport guard

10/03 2017

v1.0

1.0.0.0 https://github.com/adaojunior/passport-social-grant

Social guard for Laravel Passport

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel social oauth passport guard

20/11 2016

v1.0-beta.2

1.0.0.0-beta2 https://github.com/adaojunior/passport-social-grant

Social guard for Laravel Passport

  Sources   Download

MIT

The Requires

 

laravel social oauth passport guard

20/11 2016

v1.0-beta.1

1.0.0.0-beta1 https://github.com/adaojunior/passport-social-grant

Social guard for Laravel Passport

  Sources   Download

MIT

The Requires

 

laravel social oauth passport guard