Skip to content

Commit

Permalink
Add Google grant
Browse files Browse the repository at this point in the history
  • Loading branch information
kangaroo-val committed Apr 17, 2023
1 parent 9eac310 commit 1075b5f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Grant/CustomGrantFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ protected function registerDefaultGrant($name)

if ($name == 'facebook') {
$class = 'KangarooRewards\\OAuth2\\Client\\Grant\\' . $class;
} elseif ($name == 'google') {
$class = 'KangarooRewards\\OAuth2\\Client\\Grant\\' . $class;
} else {
$class = 'League\\OAuth2\\Client\\Grant\\' . $class;
}
Expand Down
39 changes: 39 additions & 0 deletions src/Grant/Google.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

/**
* @license http://opensource.org/licenses/MIT MIT
* @link http://thephpleague.com/oauth2-client/ Documentation
* @link https://packagist.org/packages/league/oauth2-client Packagist
* @link https://github.com/thephpleague/oauth2-client GitHub
*/

namespace KangarooRewards\OAuth2\Client\Grant;

use League\OAuth2\Client\Grant\AbstractGrant;

/**
* Represents a Google grant.
*
* @link http://tools.ietf.org/html/rfc6749#section-1.3.3 Resource Owner Password Credentials (RFC 6749, §1.3.3)
*/
class Google extends AbstractGrant
{
/**
* @inheritdoc
*/
protected function getName()
{
return 'google';
}

/**
* @inheritdoc
*/
protected function getRequiredRequestParameters()
{
return [
'username',
'google_token',
];
}
}

0 comments on commit 1075b5f

Please sign in to comment.