2017 © Pedro Peláez
 

library socialite

OAuth 1 & OAuth 2 libraries.

image

socialite-manager/socialite

OAuth 1 & OAuth 2 libraries.

  • Saturday, June 9, 2018
  • by mosaxiv
  • Repository
  • 4 Watchers
  • 15 Stars
  • 258 Installations
  • PHP
  • 14 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 12 % Grown

The README.md

Socialite

MIT License, (*1)

Introduction

This is inspired by laravel/socialite, you can easily use it without Laravel., (*2)

It possible to use it with various frameworks and middleware., (*3)

It is compatible with laravel/socialite.
You can check the Document of laravel., (*4)

Core Providers

  • twitter
  • github
  • google
  • facebook
  • bitbucket
  • linkedin

other Providers

Requirement

PHP >= 7.0

Installation

composer require socialite-manager/socialite

Basic Usage

$config = [
    'client_id' => 'xxx',
    'client_secret' => 'xxx',
    'redirect' => 'http://example.com/callback.php',
];

oath.php, (*5)

use Socialite\Socialite;

Socialite::driver('twitter', $config)->redirect();

callback.php, (*6)

use Socialite\Socialite;

$user = Socialite::driver('twitter', $config)->user();

$user->getAvatar();
$user->getEmail();
$user->getId();
$user->getNickname();
$user->getName();

Advanced Usage

Sosialite have options for use with framework and middleware, (*7)

Set Request

Interface: \Psr\Http\Message\ServerRequestInterface, (*8)

Socialite::driver('twitter', $config)
    ->setRequest($this->request);

Set Session

need one of the following read/write interfaces., (*9)

write
$session->put()
$session->set()
$session->write()
read
$session->get()
$session->read()
Socialite::driver('twitter', $config)
    ->setSession($this->request->getSession());

Redirect psr7 response

Psr\Http\Message\ResponseInterface will be returned, (*10)

Socialite::driver('twitter', $config)->psr7Redirect()

The Versions

17/03 2018
16/03 2018

v1.0.0-alpha.3

1.0.0.0-alpha3

OAuth 1 & OAuth 2 libraries.

  Sources   Download

MIT

The Requires

 

The Development Requires

oauth socialite

15/03 2018

v1.0.0-alpha.2

1.0.0.0-alpha2

OAuth 1 & OAuth 2 libraries.

  Sources   Download

MIT

The Requires

 

The Development Requires

oauth socialite

10/03 2018

v1.0.0-alpha

1.0.0.0-alpha

OAuth 1 & OAuth 2 libraries.

  Sources   Download

MIT

The Requires

 

The Development Requires

oauth socialite