PHP code example of progresivjose / piano-oauth

1. Go to this page and download the library: Download progresivjose/piano-oauth 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/ */

    

progresivjose / piano-oauth example snippets


use Progresivjose\PianoOauth;

$auth = new PianoOauth('AID', 'API_TOKEN', 'OAUTH_CLIENT_SECRET');

use Progresivjose\PianoOauth;

//Example with the Base URL
$auth = new PianoOauth('AID', 'API_TOKEN', 'OAUTH_CLIENT_SECRET', 'http://api.tinypass.io');

$returnUrl = 'https://my-site.com/post-login';

$auth->preAuth($returnUrl);

$code = $_REQUEST['code'];
$returnUrl = 'https://my-site.com/post-login';

$user = $this->postAuth($code, $returnUrl);