2014-01-20 51 views
0

With Disqus,我正在写一个OAuth我要求用户的电子邮件,但电子邮件地址不是由用户的详细信息返回。5 Disqus用户电子邮件不退还

OAuth响应

stdClass Object 
(
    [username] => Meeeeee 
    [user_id] => xxxx638 
    [access_token] => xxxxxxxxxx2db3cb0b7c10134e83 
    [expires_in] => 2592000 
    [token_type] => Bearer 
    [state] => 
    [scope] => read,write,email 
    [refresh_token] => exxxxxxxx799826a93409f6f98 
) 

用户详细请求

stdClass Object 
(
    [username] => Meeeeee 
    [numFollowers] => 0 
    [about] => 
    [name] => meeeee 
    [url] => 
    [joinedAt] => 2014-01-08T15:38:32 
    [rep] => 1.231755 
    [numFollowing] => 0 
    [connections] => stdClass Object 
     (
     ) 

    [numPosts] => 0 
    [reputation] => 1.231755 
    [location] => 
    [profileUrl] => http://disqus.com/Meeee/ 
    [isPrivate] => 
    [numLikesReceived] => 0 
    [isPrimary] => 1 
    [isAnonymous] => 
    [id] => xxxxxx638 
    [avatar] => stdClass Object 
     (
      [small] => stdClass Object 
       (
        [permalink] => https://disqus.com/api/users/avatars/meeee.jpg 
        [cache] => //a.disquscdn.com/uploads/users/8970/638/avatar32.jpg?1389195513 
       ) 

      [isCustom] => 
      [permalink] => https://disqus.com/api/users/avatars/meeee.jpg 
      [cache] => //a.disquscdn.com/uploads/users/8970/638/avatar92.jpg?1389195513 
      [large] => stdClass Object 
       (
        [permalink] => https://disqus.com/api/users/avatars/meeee.jpg 
        [cache] => //a.disquscdn.com/uploads/users/8970/638/avatar92.jpg?1389195513 
       ) 

     ) 

) 

如图在上述范围确实有用户的电子邮件。但是对用户详细信息的API请求不包含电子邮件地址,这与api不一致。我的例子是在PHP中生成的,但在使用他们的web api时也有相同的响应。

+0

当您指定了“电子邮件”范围时是否获得原始授权?你有没有尝试过与新用户,或者在撤销你的应用程序后再次检查? –

+0

我不确定,它经历了很多迭代,但我猜测没有。我将如何完全撤销应用程序泄露,然后重新开始? –

+0

转到http://disqus.com/account/ - 然后单击“应用程序”选项卡并撤销您的应用程序。然后重新启动授权过程。您应该在新授权授权窗口中看到电子邮件许可警告。 –

回答

0

email范围仅在使用audiencesync grant_type时可用,所以这对于常规OAuth应用程序不起作用。

使用标准的OAuth流,以获得一个电子邮件地址的唯一方法是,如果你:

  1. 自己的网站
  2. 使用自己的身份验证(与admin grant_type)
  3. 用户参加在您的网站上
相关问题