PHP code example of leandroferreirama / itau-auth

1. Go to this page and download the library: Download leandroferreirama/itau-auth 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/ */

    

leandroferreirama / itau-auth example snippets




eandroFerreiraMa\ItauAuth\Auth;

$url = (new Auth)->url(GOOGLE_CLIENT_ID, GOOGLE_CLIENT_REDIRECT_URL);




set($_GET['code'])){
    $data = (new Auth)->accessToken(GOOGLE_CLIENT_ID, GOOGLE_CLIENT_REDIRECT_URL, GOOGLE_CLIENT_SECRET, $_GET['code']);
    $token = $data->access_token;
    $refresh_token = $data->refresh_token;
}



data = (new Auth)->refreshToken(GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, $refresh_token);
    $token = $data->access_token;
}