Commit fe46caf7 by Klimov Paul

User attributes fetching at `VKontakte` adjusted

parent 9eec6191
...@@ -12,7 +12,8 @@ use yii\authclient\OAuth2; ...@@ -12,7 +12,8 @@ use yii\authclient\OAuth2;
/** /**
* VKontakte allows authentication via VKontakte OAuth. * VKontakte allows authentication via VKontakte OAuth.
* *
* In order to use VKontakte OAuth you must register your application at <http://vk.com/apps.php?act=add&site=1>. * In order to use VKontakte OAuth you must register your application at <http://vk.com/editapp?act=create>.
*
* *
* Example application configuration: * Example application configuration:
* *
...@@ -32,7 +33,7 @@ use yii\authclient\OAuth2; ...@@ -32,7 +33,7 @@ use yii\authclient\OAuth2;
* ] * ]
* ~~~ * ~~~
* *
* @see http://vk.com/apps.php?act=add&site=1 * @see http://vk.com/editapp?act=create
* @see http://vk.com/developers.php?oid=-1&p=users.get * @see http://vk.com/developers.php?oid=-1&p=users.get
* *
* @author Paul Klimov <klimov.paul@gmail.com> * @author Paul Klimov <klimov.paul@gmail.com>
...@@ -73,7 +74,7 @@ class VKontakte extends OAuth2 ...@@ -73,7 +74,7 @@ class VKontakte extends OAuth2
'photo' 'photo'
]), ]),
]); ]);
return $attributes; return array_shift($attributes['response']);
} }
/** /**
...@@ -101,4 +102,14 @@ class VKontakte extends OAuth2 ...@@ -101,4 +102,14 @@ class VKontakte extends OAuth2
{ {
return 'VKontakte'; return 'VKontakte';
} }
/**
* @inheritdoc
*/
protected function defaultNormalizeUserAttributeMap()
{
return [
'id' => 'uid'
];
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment