PHP code example of socialiteproviders / usos

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

    

socialiteproviders / usos example snippets


'usos' => [
  'domain' => env('USOS_DOMAIN_URL'), // Because of every instance of USOS is self-hosted
  'client_id' => env('USOS_CLIENT_ID'),
  'client_secret' => env('USOS_CLIENT_SECRET'),
  'redirect' => env('USOS_REDIRECT_URI')
],

'usos' => [
  // ...
  'profile_fields_selector' => env('USOS_PROFILE_FIELDS_SELECTOR'),
  // ...
]

Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
    $event->extendSocialite('usos', \SocialiteProviders\Usos\Provider::class);
});

protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \SocialiteProviders\Usos\UsosExtendSocialite::class.'@handle',
    ],
];

return Socialite::driver('usos')->redirect();

return Socialite::driver('usos')
    ->scopes(['personal', 'email'])
    ->redirect();