PHP code example of frente-patria-grande / ah-auth

1. Go to this page and download the library: Download frente-patria-grande/ah-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/ */

    

frente-patria-grande / ah-auth example snippets


//...
'argentina-humana' => [
    'base_url' => rtrim(env('ARGENTINA_HUMANA_BASE_URL', 'https://cuenta.argentinahumana.com.ar'), '/'),
    'client_id' => env('ARGENTINA_HUMANA_CLIENT_ID'),
    'client_secret' => env('ARGENTINA_HUMANA_CLIENT_SECRET'),
    'redirect' => env('ARGENTINA_HUMANA_CALLBACK_URL'),
],
//...

use FrentePatriaGrande\AHAuth\Traits\HasSocialiteAuth;

class User ... {
    use HasSocialiteAuth;
}

php artisan vendor:publish --tag="ah-auth-migrations"
php artisan migrate

// Redirect to login
Socialite::driver('argentina-humana')->redirect();
            
// Login callback
/** @var \Laravel\Socialite\Two\User $socialiteUser */
$socialiteUser = Socialite::driver('argentina-humana')->user();
// $socialiteUser->email;
// $socialiteUser->token;
// $socialiteUser->refreshToken;