PHP code example of mnastalski / allegro-socialite

1. Go to this page and download the library: Download mnastalski/allegro-socialite 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/ */

    

mnastalski / allegro-socialite example snippets


'allegro' => [    
    'client_id' => env('ALLEGRO_CLIENT_ID'),
    'client_secret' => env('ALLEGRO_CLIENT_SECRET'),
    'redirect' => env('ALLEGRO_REDIRECT'),
],

'sandbox' => env('ALLEGRO_SANDBOX', false),

use Laravel\Socialite\Facades\Socialite;

$provider = Socialite::driver('allegro');

$provider->redirect();
$provider->user();
$provider->getAccessToken();

Socialite::driver('allegro')->getRefreshTokenResponse($refreshToken);

[
    'access_token' => '...',
    'token_type' => 'bearer',
    'refresh_token' => '...',
    'expires_in' => 43199,
    'scope' => 'allegro:api:profile:read',
    'allegro_api' => true,
    'jti' => '...',
]