PHP code example of chadhutchins / oauth2-suitecrm

1. Go to this page and download the library: Download chadhutchins/oauth2-suitecrm library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

chadhutchins / oauth2-suitecrm example snippets


$provider = new \League\OAuth2\Client\Provider\GenericProvider([
    'clientId'                => 'SuiteCRM Client ID',    // The client ID assigned to you by the provider
    'clientSecret'            => 'SuiteCRM Client Secret',    // The client password assigned to you by the provider
    'redirectUri'             => 'https://my.example.com/your-redirect-url/',
    'urlAuthorize'            => 'https://your-suitecrm-instance.com/Api/authorize', // not used but still ion\IdentityProviderException $e) {

    // Failed to get the access token
    exit($e->getMessage());

}