Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fedex google sso #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/Grant/GoogleSso.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace GetPhoto\Oauth2\Client\Grant;

/**
* Impersonate grant
* Grant for trusted client to impersonate user
*
* @author navihtot [email protected]
*/
class GoogleSso extends \League\OAuth2\Client\Grant\AbstractGrant {
/**
* @inheritdoc
*/
protected function getName() {
return 'google_sso';
}

/**
* @inheritdoc
*/
protected function getRequiredRequestParameters() {
return [
'id_token',
];
}
}
4 changes: 4 additions & 0 deletions src/Provider/OauthProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace GetPhoto\Oauth2\Client\Provider;

use GetPhoto\Oauth2\Client\Grant\GoogleSso;
use League\OAuth2\Client\Provider\AbstractProvider;
use InvalidArgumentException;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
Expand Down Expand Up @@ -79,6 +80,9 @@ public function __construct(array $options = [], array $collaborators = []) {
//impersonate grant
$this->grantFactory->setGrant('impersonate', new Impersonate);

//google sso grant
$this->grantFactory->setGrant('google_sso', new GoogleSso);

//setting logger
if (empty($collaborators['logger'])) {
$collaborators['logger'] = new Logger();
Expand Down