mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 21:52:35 +01:00
1e323a5770
* Working on OAuth * Fixes for gmail transport * Working on oauth
29 lines
519 B
PHP
29 lines
519 B
PHP
<?php
|
|
|
|
namespace App\Libraries\OAuth\Providers;
|
|
|
|
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 havestName($payload)
|
|
{
|
|
return $payload['name'];
|
|
}
|
|
|
|
}
|