PHP code example of gerulla / xivauth-provider

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

    

gerulla / xivauth-provider example snippets


'xivauth' => [
    'client_id' => env('XIVAUTH_CLIENT_ID'),
    'client_secret' => env('XIVAUTH_CLIENT_SECRET'),
    'redirect' => env('XIVAUTH_REDIRECT_URI'),
]

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

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

$user = Socialite::driver('xivauth')->user()

return Socialite::driver('xivauth')->withCharactersScope()->redirect(); // characters:all
return Socialite::driver('xivauth')->withEmailScope()->redirect(); // user:email
return Socialite::driver('xivauth')->withSocialScope()->redirect(); // user:social

return Socialite::driver('xivauth')->withExtraScopes(['user:email', 'user:social', 'characters:all'])->redirect();