OVH OAuth2 Provider for SocialiteProviders
composer require socialiteproviders/ovh
Please see the Base Installation Guide, then follow the provider specific instructions below.
Follow this link to create your application's credentials at OVH's.
First choose the "endpoint" (which is the service and the country) then click on the link "Create application credentials" under the right endpoint.
'ovh' => [ 'client_id' => env('OVH_APP_KEY'), 'client_secret' => env('OVH_APP_SECRET'), 'endpoint' => env('OVH_ENDPOINT'), 'redirect' => env('OVH_REDIRECT_URI'), ],
Configure the package's listener to listen for
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\\Ovh\\OvhExtendSocialite@handle', ], ];
You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed):
id(being the consumerKey)
More fields are available under the
$user = Socialite::driver('ovh')->user(); $phone = $user->user['phone']; $country = $user->user['country'];