Skip to content

Commit

Permalink
Add Google::getScopeInline().
Browse files Browse the repository at this point in the history
This allows specifying each scope as a separate array value in config
instead of an array with single space separated string.
  • Loading branch information
ADmad authored and ovr committed Apr 19, 2017
1 parent ee74272 commit 3d2766b
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 57 deletions.
115 changes: 58 additions & 57 deletions example/config.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,123 +4,124 @@
* @author: Patsura Dmitry https://github.com/ovr <[email protected]>
*/

return array(
return [
'redirectUri' => 'http://localhost:8000/auth/cb',
'provider' => array(
'facebook' => array(
'provider' => [
'facebook' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array('email')
),
'twitter' => array(
'scope' => ['email']
],
'twitter' => [
'applicationId' => '',
'applicationSecret' => '',
'enabled' => false
),
'google' => array(
],
'google' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array(
'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile'
)
),
'paypal' => array(
'scope' => [
'https://www.googleapis.com/auth/userinfo.email',
'https://www.googleapis.com/auth/userinfo.profile'
]
],
'paypal' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array(
'scope' => [
'profile',
'email',
'address',
'phone',
'https://uri.paypal.com/services/paypalattributes'
)
),
'vk' => array(
]
],
'vk' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array('email')
),
'github' => array(
'scope' => ['email']
],
'github' => [
'applicationId' => '',
'applicationSecret' => '',
),
'instagram' => array(
],
'instagram' => [
'applicationId' => '',
'applicationSecret' => '',
),
'slack' => array(
],
'slack' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array(
'scope' => [
'identity.basic',
'identity.email',
'identity.team',
'identity.avatar',
)
),
'twitch' => array(
]
],
'twitch' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array('user_read')
),
'px500' => array(
'scope' => ['user_read']
],
'px500' => [
'applicationId' => '',
'applicationSecret' => ''
),
'bitbucket' => array(
],
'bitbucket' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array('account')
),
'amazon' => array(
'scope' => ['account']
],
'amazon' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array('profile')
),
'gitlab' => array(
'scope' => ['profile']
],
'gitlab' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array('read_user')
),
'vimeo' => array(
'scope' => ['read_user']
],
'vimeo' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array()
),
'digital-ocean' => array(
'scope' => []
],
'digital-ocean' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array()
),
'yandex' => array(
'scope' => []
],
'yandex' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array()
),
'scope' => []
],
//http://api.mail.ru/sites/my/add
'mail-ru' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array()
'scope' => []
],
//http://api.mail.ru/sites/my/add
'odnoklassniki' => [
'applicationId' => '',
'applicationSecret' => '',
'applicationPublic' => '',
'scope' => array(
'scope' => [
'GET_EMAIL'
)
]
],
'steam' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array()
'scope' => []
],
'tumblr' => [
'applicationId' => '',
'applicationSecret' => '',
'scope' => array()
'scope' => []
]
)
);
]
];
8 changes: 8 additions & 0 deletions src/OAuth2/Provider/Google.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,12 @@ public function getIdentity(AccessTokenInterface $accessToken)

return $hydrator->hydrate(new User(), $result);
}

/**
* {@inheritdoc}
*/
public function getScopeInline()
{
return implode(' ', $this->scope);
}
}

0 comments on commit 3d2766b

Please sign in to comment.