2016-01-11 30 views
2

那么我使用谷歌,FB和Twitter的HybridAuth和FB工作得很好,谷歌返回空用户配置文件。HybridAuth getUserProfile返回试图获取非对象的属性

的accessToken是OK

getUserProfile()数据设置为NULL:

object(Hybrid_User)#8 (3) { ["providerId"]=> string(6) "Google" ["timestamp"]=> int(1452502079) ["profile"]=> object(Hybrid_User_Profile)#9 (22) { ["identifier"]=> NULL ["webSiteURL"]=> NULL ["profileURL"]=> NULL ["photoURL"]=> NULL ["displayName"]=> NULL ["description"]=> NULL ["firstName"]=> NULL ["lastName"]=> NULL ["gender"]=> NULL ["language"]=> NULL ["age"]=> NULL ["birthDay"]=> NULL ["birthMonth"]=> NULL ["birthYear"]=> NULL ["email"]=> NULL ["emailVerified"]=> NULL ["phone"]=> NULL ["address"]=> NULL ["country"]=> NULL ["region"]=> NULL ["city"]=> NULL ["zip"]=> NULL } } } } 

任何想法要检查什么?

+0

#CLOSED好了,它已经修复了。它似乎需要在项目中启用Google+ API。 – carli

回答

1

仅指向具有相同行为的其他用户。 您可以通过在配置文件中添加参数启用调试模式,就这样

array(
    "base_url" => "", 
    "providers" => array (
     "Google" => array ( 
      "enabled" => true, 
      "keys" => array ("id" => "", "secret" => "") 
     ), 
     "Facebook" => array ( 
      "enabled" => true, 
      "keys" => array ("id" => "", "secret" => "") 
     ), 
     "Twitter" => array ( 
      "enabled" => true, 
      "keys" => array ("key" => "", "secret" => ""), 
      "includeEmail" => true 
     ), 
    ), 

    // if you want to enable logging, set 'debug_mode' to true 
    "debug_mode" => false, 
    // then provide a writable file by the web server on "debug_file" 
    "debug_file" => "log.txt" 
); 

那么你可以查看日志,这是正确的使用谷歌的用户数据,我们需要启用谷歌开发者控制台, 并需要在谷歌+ API在传播过程中等待一段时间

相关问题