2017 © Pedro Peláez
 

library oauth2-steein

Steein OAuth 2.0 Client Provider for The PHP

image

steein/oauth2-steein

Steein OAuth 2.0 Client Provider for The PHP

  • Sunday, July 9, 2017
  • by Steein
  • Repository
  • 0 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Steein for OAuth 2.0 Client

This package provides support for Steein OAuth 2.0 for the OAuth 2.0 PHP client., (*1)

Requirements

The following versions of PHP are supported., (*2)

  • PHP >= 5.6
  • HHVM

Installation

To install, use composer:, (*3)

composer require steein/oauth2-steein

Usage

Usage is the same as The OAuth client, using \Steein\OAuth2\Client\Steein as the provider., (*4)

Authorization Code Flow


$provider = new \Steein\OAuth2\Client\Steein([ 'clientId' => '{client_id}', 'clientSecret' => '{client_secret}', 'redirectUrl' => '{callback_url}', 'ApiVersion' => '2.0', ]); if (!isset($_GET['code'])) { // Если у нас нет кода авторизации, $authUrl = $provider->getAuthorizationUrl(); echo '<a href="'.$authUrl.'">Авторизация через Steein!</a>'; } else { // Попробуйте получить токен доступ (используя грант кода авторизации) $token = $provider->getAccessToken('authorization_code', [ 'code' => $_GET['code'], 'grant_type' => 'authorization_code' ]); try { // Теперь у нас есть токен доступ, давайте теперь узнаем подробности пользователя. $user = $provider->getResourceOwner($token); // $user->get...(); echo $user->getDisplayName().'<br />'; echo $user->getAvatar().'<br />'; } catch (Exception $e) { exit('Что та пошло не так'); } }

License

The MIT License (MIT). Please see License File for more information., (*5)

The Versions

09/07 2017

dev-master

9999999-dev

Steein OAuth 2.0 Client Provider for The PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication authorization oauth client oauth2 steein steein oauth2

08/07 2017

v1.1

1.1.0.0

Steein OAuth 2.0 Client Provider for The PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication authorization oauth client oauth2 steein steein oauth2

25/04 2017

v1.0

1.0.0.0

Steein OAuth 2.0 Client Provider for The PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication authorization oauth client oauth2 steein steein oauth2