composer require flightsimcorp/fsidentity-socialite-provider
Please see the Base Installation Guide, then follow the provider specific instructions below.
Create an application at https://fsidentity.com/clients/new
Its important that you verify the following OAuth Settings are configured for your FSIdentity application:
- Token Endpoint Authentication Method:
Client Secret Basic Auth
- Grant Types:
Authorization Code
'fsidentity' => [
'client_id' => env('FSIDENTITY_CLIENT_ID'),
'client_secret' => env('FSIDENTITY_CLIENT_SECRET'),
'redirect' => env('FSIDENTITY_REDIRECT_URI'),
],
Configure the package's listener to listen for SocialiteWasCalled
events.
Add the event to your listen[]
array in app/Providers/EventServiceProvider
. See the Base Installation Guide for detailed instructions.
protected $listen = [
\SocialiteProviders\Manager\SocialiteWasCalled::class => [
// ... other providers
\SocialiteProviders\FSIdentity\FSIdentityExtendSocialite::class.'@handle',
],
];
You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed):
return Socialite::driver('fsidentity')->redirect();
To add scopes to your Authentication you can use the below:
return Socialite::driver('fsidentity')->scopes(['name', 'email'])->redirect();
To add required scopes (those the user cannot opt out from) to your Authentication you can use the below:
return Socialite::driver('fsidentity')->requiredScopes(['name', 'email'])->redirect();
id
name
email
preferred_username
avatar_url
locale
timezone