我已经实施了扩展程序EAuth Yii2,以便通过Gmail进行身份验证。 直到现在,除了我无法获得用户的邮件之外,这一切都很好,这个方法选择我的用户名,ID,谷歌加帐户但不带给我邮件帐户。并在谷歌看看,找不到解决方案,有人我救命,拜托。 YII :: $ APP->用户&GT同一性
答案 0 :(得分:0)
I answer myself, because I found the solution and put it in case someone else's worth it:
Change the 'scope' of the next line:
protected $scopes = array(self::SCOPE_USERINFO_PROFILE);
For this other:
protected $scopes = array(self::SCOPE_USERINFO_EMAIL);
And finally display the mail attribute.
$this->attributes['email'] = $info['email'];