Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
39436410
Commit
39436410
authored
Jul 11, 2014
by
Klimov Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User attributes requesting at GoogleOAuth switched to Google+ API
parent
98d3a8c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
CHANGELOG.md
extensions/authclient/CHANGELOG.md
+1
-0
GoogleOAuth.php
extensions/authclient/clients/GoogleOAuth.php
+9
-7
No files found.
extensions/authclient/CHANGELOG.md
View file @
39436410
...
@@ -6,6 +6,7 @@ Yii Framework 2 authclient extension Change Log
...
@@ -6,6 +6,7 @@ Yii Framework 2 authclient extension Change Log
-
Bug #3633: OpenId return URL comparison advanced to prevent url encode problem (klimov-paul)
-
Bug #3633: OpenId return URL comparison advanced to prevent url encode problem (klimov-paul)
-
Enh #3416: VKontakte OAuth support added (klimov-paul)
-
Enh #3416: VKontakte OAuth support added (klimov-paul)
-
Enh #4139: User attributes requesting at GoogleOAuth switched to Google+ API (klimov-paul)
2.0.0-beta April 13, 2014
2.0.0-beta April 13, 2014
...
...
extensions/authclient/clients/GoogleOAuth.php
View file @
39436410
...
@@ -12,7 +12,10 @@ use yii\authclient\OAuth2;
...
@@ -12,7 +12,10 @@ use yii\authclient\OAuth2;
/**
/**
* GoogleOAuth allows authentication via Google OAuth.
* GoogleOAuth allows authentication via Google OAuth.
*
*
* In order to use Google OAuth you must register your application at <https://code.google.com/apis/console#access>.
* In order to use Google OAuth you must create a project at <https://console.developers.google.com/project>
* and setup its credentials at <https://console.developers.google.com/project/[yourProjectId]/apiui/credential>.
* In order to enable using scopes for retrieving user attributes, you should also enable Google+ API at
* <https://console.developers.google.com/project/[yourProjectId]/apiui/api/plus>
*
*
* Example application configuration:
* Example application configuration:
*
*
...
@@ -32,8 +35,7 @@ use yii\authclient\OAuth2;
...
@@ -32,8 +35,7 @@ use yii\authclient\OAuth2;
* ]
* ]
* ~~~
* ~~~
*
*
* @see https://code.google.com/apis/console#access
* @see https://console.developers.google.com/project
* @see https://developers.google.com/google-apps/contacts/v3/
*
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
* @since 2.0
...
@@ -51,7 +53,7 @@ class GoogleOAuth extends OAuth2
...
@@ -51,7 +53,7 @@ class GoogleOAuth extends OAuth2
/**
/**
* @inheritdoc
* @inheritdoc
*/
*/
public
$apiBaseUrl
=
'https://www.googleapis.com/
oauth2
/v1'
;
public
$apiBaseUrl
=
'https://www.googleapis.com/
plus
/v1'
;
/**
/**
* @inheritdoc
* @inheritdoc
...
@@ -61,8 +63,8 @@ class GoogleOAuth extends OAuth2
...
@@ -61,8 +63,8 @@ class GoogleOAuth extends OAuth2
parent
::
init
();
parent
::
init
();
if
(
$this
->
scope
===
null
)
{
if
(
$this
->
scope
===
null
)
{
$this
->
scope
=
implode
(
' '
,
[
$this
->
scope
=
implode
(
' '
,
[
'
https://www.googleapis.com/auth/userinfo.
profile'
,
'profile'
,
'
https://www.googleapis.com/auth/userinfo.
email'
,
'email'
,
]);
]);
}
}
}
}
...
@@ -72,7 +74,7 @@ class GoogleOAuth extends OAuth2
...
@@ -72,7 +74,7 @@ class GoogleOAuth extends OAuth2
*/
*/
protected
function
initUserAttributes
()
protected
function
initUserAttributes
()
{
{
return
$this
->
api
(
'
userinfo
'
,
'GET'
);
return
$this
->
api
(
'
people/me
'
,
'GET'
);
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment