2017 © Pedro PelĂĄez
 

library oauth2-assembla

image

rmasters/oauth2-assembla

  • Monday, November 2, 2015
  • by rmasters
  • Repository
  • 1 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Assembla provider for League OAuth 2 Client

This package provides a simple Assembla provider for The PHP League OAuth2 Client., (*1)

 Usage

composer require rmasters/oauth2-assembla
$provider = new Assembla([
  'clientId' => getenv('ASSEMBLA_CLIENT_ID'),
  'clientSecret' => getenv('ASSEMBLA_CLIENT_SECRET'),
  'redirectUri' => getenv('ASSEMBLA_REDIRECT_URI'),
]);

// Send to Assembla for authorization
if (!isset($_GET['code'])) {
    header('Location: ' . $provider->getAuthorizationUrl());
    exit;
}

// Get an access token from an authorization code
$token = $provider->getAccessToken('authorization_code', ['code' => $_GET['code']]);
$_SESSION['assembla'] = $token;

// Get the authenticated user
$user = $provider->getResourceOwner($token);
assert($user instanceof AssemblaResourceOwner);
printf("Logged in as %s", $user->getName());

License

MIT Licensed, (*2)

The Versions

02/11 2015

dev-master

9999999-dev https://github.com/rmasters/oauth2-assembla

  Sources   Download

MIT

The Requires

 

oauth2 assembla

02/11 2015

v1.0

1.0.0.0 https://github.com/rmasters/oauth2-assembla

  Sources   Download

MIT

The Requires

 

oauth2 assembla