2017 © Pedro Peláez
 

library oauth2-formassembly

FormAssembly OAuth 2.0 Client Provider for The PHP League OAuth2-Client

image

fathershawn/oauth2-formassembly

FormAssembly OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  • Friday, January 26, 2018
  • by fathershawn
  • Repository
  • 0 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 18 % Grown

The README.md

oauth2-formassembly

This package provides FormAssembly OAuth 2.0 support for the PHP League's OAuth 2.0 Client., (*1)

Installation

To install, use composer:, (*2)

composer require fathershawn/oauth2-formassembly

Usage

Request an authorization code

If you are working with FormAssembly, you may have another class by that name, so you can rename the provider:, (*3)

<?php
use Fathershawn\OAuth2\Client\Provider\FormAssembly as OauthProvider;

$provider = new OauthProvider([
      'clientId' => 'your-client-id',
      'clientSecret' => 'your-client-secret',
      'redirectUri' => 'url-to-capture-the-code',
      'baseUrl' => 'url-to-formassembly-instance',
]);
$url = $provider->getAuthorizationUrl();
// Redirect the user to $url.

When the user is redirected to the url to capture the code:, (*4)

<?php

use Fathershawn\OAuth2\Client\Provider\FormAssembly as OauthProvider;
// Capture the code with your framework or from $_GET['code'].
$code = $_GET['code'];
$provider = new OauthProvider([
      'clientId' => 'your-client-id',
      'clientSecret' => 'your-client-secret',
      'redirectUri' => 'url-to-capture-the-code',
      'baseUrl' => 'url-to-formassembly-instance',
]);
try {
    $accessToken = $provider->getAccessToken('authorization_code', [
        'code' => $code,
    ]);
    // Store $accessToken as appropriate for re-use.
} catch (Exception $e) {
    // Log the Exception?
    throw $e;
}

The Versions

26/01 2018

dev-master

9999999-dev

FormAssembly OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

GPL2 GPL-2.0-or-later

The Requires

 

The Development Requires

authentication authorization oauth client oauth2 formassembly

26/01 2018

1.0.1

1.0.1.0

FormAssembly OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

GPL-2.0-or-later

The Requires

 

The Development Requires

authentication authorization oauth client oauth2 formassembly

20/08 2017

1.0.0

1.0.0.0

FormAssembly OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

GPL2

The Requires

 

The Development Requires

authentication authorization oauth client oauth2 formassembly