2017 © Pedro Peláez
 

library oauth-contact-duty

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

image

contactduty/oauth-contact-duty

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

  • Monday, March 26, 2018
  • by floringavrila
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ContactDuty Provider for OAuth 2.0 Client

ContactDuty OAuth 2.0 support for the PHP League’s OAuth 2.0 Client., (*1)

Installation

$ composer require contactduty/oauth-contact-duty

Usage

You can get your OAuth client credentials here., (*2)

try {
    $provider = new ContactDuty\OAuth2\Client([
        'clientId'          => $clientId,
        'clientSecret'      => $clientSecret,
        'redirectUri'       => $redirectUri
    ]);

    $accessToken = $provider->getAccessToken('client_credentials');

    echo 'Access Token: ' . $accessToken->getToken() . "<br>";
    echo 'Expired in: ' . $accessToken->getExpires() . "<br>";
    echo 'Already expired? -> ' . ($accessToken->hasExpired() ? 'expired' : 'not expired') . "<br>";

 } catch (League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) {
    // Failed to get the access token
    die($e->getMessage());
}

The Versions

26/03 2018

dev-master

9999999-dev https://contactduty.com/

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

  Sources   Download

MIT

The Requires

 

by Gavrila Florin