serdud/socialite-google-one-tap

Google One Tap provider for Laravel Socialite

v2.1.0 2024-03-10 20:49 UTC

This package is auto-updated.

Last update: 2024-04-10 21:02:36 UTC


README

Latest Version on Packagist Total Downloads

Installation & Basic Usage

composer require serdud/socialite-google-one-tap

Add configuration to config/services.php

'google' => [
  'client_id' => env('GOOGLE_CLIENT_ID'),
  'client_secret' => env('GOOGLE_CLIENT_SECRET'),
  'redirect' => env('GOOGLE_REDIRECT_URI')
],

Usage

You should now be able to use the provider like you would regularly use Socialite:

return Socialite::driver('google-one-tap')->stateless()->userFromToken($token);

Note Use google driver name if you're using version < 2.0.0

Note The token is returned in the credential field

Returned User fields

  • id
  • nickname
  • name
  • email
  • avatar
  • given_name
  • family_name

Credits

License

The MIT License (MIT). Please see License File for more information.