mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-18 09:04:35 +01:00
31 lines
539 B
PHP
31 lines
539 B
PHP
<?php
|
|
|
|
namespace App\Libraries\OAuth\Providers;
|
|
|
|
use Google_Client;
|
|
|
|
class Google implements ProviderInterface
|
|
{
|
|
public function getTokenResponse($token)
|
|
{
|
|
$client = new Google_Client();
|
|
|
|
return $client->verifyIdToken($token);
|
|
}
|
|
|
|
public function harvestEmail($payload)
|
|
{
|
|
return $payload['email'];
|
|
}
|
|
|
|
public function harvestSubField($payload)
|
|
{
|
|
return $payload['sub']; // user ID
|
|
}
|
|
|
|
public function harvestName($payload)
|
|
{
|
|
return $payload['name'];
|
|
}
|
|
}
|