tmannherz / oauth2-ringcentral
RingCentral OAuth 2.0 Client Provider for The PHP League OAuth2-Client
Installs: 2 033
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: >=5.5.0
- league/oauth2-client: ^1.0
This package is auto-updated.
Last update: 2024-10-16 08:06:18 UTC
README
This package provides RingCentral OAuth 2.0 support for the PHP League's OAuth 2.0 Client.
Installation
To install, use composer:
composer require tmannherz/oauth2-ringcentral
Usage
Usage is the same as The League's OAuth client, using \TMannherz\OAuth2\Client\Provider\Ringcentral
as the provider.
Resource Owner Password Credentials Grant
$provider = new TMannherz\OAuth2\Client\Provider\Ringcentral([ 'clientId' => 'rc_app_id', 'clientSecret' => 'rc_app_secret' ]); $provider->setDevMode(); // enable sandbox mode try { // Try to get an access token using the resource owner password credentials grant. $accessToken = $provider->getAccessToken('password', [ 'username' => 'rc_number', 'password' => 'rc_pass' ]); } catch (\Exception $e) { exit($e->getMessage()); }
License
The MIT License (MIT). Please see License File for more information.