2017 © Pedro Peláez
 

library oauth2-hubspot

HubSpot OAuth 2 Client Provider for The PHP League OAuth2-Client package

image

helpscout/oauth2-hubspot

HubSpot OAuth 2 Client Provider for The PHP League OAuth2-Client package

  • Wednesday, March 22, 2017
  • by stevenwadejr
  • Repository
  • 4 Watchers
  • 1 Stars
  • 45 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 32 % Grown

The README.md

HubSpot Provider for OAuth 2.0 Client

Latest Version Software license Build Status, (*1)

This package provides a HubSpot OAuth 2.0 support for the PHP League's OAuth 2.0 Client., (*2)

Installation

To install, use composer:, (*3)

composer require helpscout/oauth2-hubspot

Usage

Usage is the same as The League's OAuth client, using \HelpScout\OAuth2\Client\Provider\HubSpot as the provider., (*4)

Authorization Code Flow

$provider = new HelpScout\OAuth2\Client\Provider\HubSpot([
    'clientId'          => '{hubspot-client-id}',
    'clientSecret'      => '{hubspot-client-secret}',
    'redirectUri'       => 'https://example.com/callback-url'
]);

For further usage of this package please refer to the core package documentation on "Authorization Code Grant"., (*5)

Refreshing a Token

$provider = new HelpScout\OAuth2\Client\Provider\HubSpot([
    'clientId'          => '{hubspot-client-id}',
    'clientSecret'      => '{hubspot-client-secret}',
    'redirectUri'       => 'https://example.com/callback-url'
]);

$existingAccessToken = getAccessTokenFromYourDataStore();

if ($existingAccessToken->hasExpired()) {
    $newAccessToken = $provider->getAccessToken('refresh_token', [
        'refresh_token' => $existingAccessToken->getRefreshToken()
    ]);

    // Purge old access token and store new access token to your data store.
}

For further usage of this package please refer to the core package documentation on "Refreshing a Token"., (*6)

Testing

bash $ ./vendor/bin/phpunit, (*7)

Contributing

Please see CONTRIBUTING for details., (*8)

Credits

License

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

The Versions

22/03 2017

dev-master

9999999-dev

HubSpot OAuth 2 Client Provider for The PHP League OAuth2-Client package

  Sources   Download

MIT

The Requires

 

The Development Requires

by Platform Group

authorization oauth client oauth2 authorisation hubspot

22/03 2017

dev-develop

dev-develop

HubSpot OAuth 2 Client Provider for The PHP League OAuth2-Client package

  Sources   Download

MIT

The Requires

 

The Development Requires

by Platform Group

authorization oauth client oauth2 authorisation hubspot

22/03 2017

0.1.1

0.1.1.0

HubSpot OAuth 2 Client Provider for The PHP League OAuth2-Client package

  Sources   Download

MIT

The Requires

 

The Development Requires

by Platform Group

authorization oauth client oauth2 authorisation hubspot

15/03 2017

0.1.0

0.1.0.0

HubSpot OAuth 2 Client Provider for The PHP League OAuth2-Client package

  Sources   Download

MIT

The Requires

 

The Development Requires

by Platform Group

authorization oauth client oauth2 authorisation hubspot