使用Disqus,我正在写OAuth
我要求用户的电子邮件,但用户的详细信息并未返回电子邮件地址。
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)
email
范围仅在使用audiencesync
grant_type时可用,因此这不适用于常规OAuth应用程序。
使用标准OAuth流程获取电子邮件地址的唯一方法是:
admin
grant_type)