Skip to content

RingCentral provider for league/oauth2-client

License

Notifications You must be signed in to change notification settings

jiminny/oauth2-ringcentral

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RingCentral provider for OAuth 2.0 Client

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.

About

RingCentral provider for league/oauth2-client

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%