2017 © Pedro Peláez
 

library oauth2-next-engine

Next Engine OAuth 2.0 Client Provider for The PHP League OAuth2-Client

image

shippinno/oauth2-next-engine

Next Engine OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  • Friday, June 9, 2017
  • by tanigami
  • Repository
  • 4 Watchers
  • 0 Stars
  • 942 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 152 % Grown

The README.md

Next Engine Provider for OAuth 2.0 Client

Scrutinizer Code Quality Code Coverage Build Status Build Status, (*1)

This package provides Resource Next Engine OAuth 2.0 support for the PHP League’s OAuth 2.0 Client., (*2)

Installation

To install, use composer:, (*3)

composer require w-takumi/oauth2-next-engine

Usage

Usage is the same as The League’s OAuth client, using \Shippinno\NextEngine\OAuth2\Client\Provider\NextEngineProvider as the provider., (*4)

Authorization Code Flow

<?php

$provider = new \Shippinno\NextEngine\OAuth2\Client\Provider\NextEngineProvider([
    'clientId'          => '{next-engine-client-id}',
    'clientSecret'      => '{next-engine-lient-secret}',
    'redirectUri'       => 'https://example.com/callback',
]);

if (!isset($_GET['uid']) || !isset($_GET['state'])) {
    $authUrl = $provider->getAuthorizationUrl();
    header('Location: '.$authUrl);
    exit;
} else {
    $token = $nextEngineProvider->getAccessToken('client_credentials', [
        'uid' => $_GET['uid'],
        'state' => $_GET['state']
    ]);

    try {
        $user = $provider->getResourceOwner($token);
        printf('Hello %s!', $user->getCompanyName());
    } catch (Exception $e) {
        exit('Oh dear...');
    }

    echo $token->getToken();
}

The Versions

09/06 2017

dev-master

9999999-dev

Next Engine OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tadashi Gondo
by Eiji Muraguchi
by Yuji Fukui
by Aya Kanazawa

07/06 2017

0.0.1

0.0.1.0

Next Engine OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tadashi Gondo
by Eiji Muraguchi
by Yuji Fukui
by Aya Kanazawa