【发布时间】:2014-12-26 11:44:36
【问题描述】:
我在我的应用程序中使用 spring-security-oauth-facebook:0.1 grails 插件。现在我想访问人员的电子邮件 ID,但每次 facebook 服务器响应时我都无法响应 1829812989120 对于 socialId 、Username、profileId 并且在返回 Map 对象时没有电子邮件选项。为什么会这样。
oauth {
debug = true
providers {
facebook {
api = org.scribe.builder.api.FacebookApi
key = 'my-app-key'
secret = 'secret-key'
successUri = '/oauth/facebook/success'
failureUri = '/oauth/facebook/failure'
callback = "${baseURL}/oauth/facebook/callback"
scopes = "['public_profile','email','name','user']"
}
def sessionKey = oauthService.findSessionKeyForAccessToken(provider)
if (!session[sessionKey]) {
log.warn "No OAuth token in the session for provider '${provider}'"
throw new OAuthLoginException("Authentication error for provider '${provider}'")
}
// Create the relevant authentication token and attempt to log in.
OAuthToken oAuthToken = springSecurityOAuthService.createAuthToken(provider,
session[sessionKey])
println "oAuthToken.principal = "+oAuthToken.principal.toString();
println "oAuthToken.socialId = "+oAuthToken.socialId;
println "oAuthToken.properties= "+oAuthToken.properties
println "oAuthToken.properties= "+oAuthToken.name
println "oAuthToken.properties= "+oAuthToken.toString();
1)我检查了所有 println 值的电子邮件都不存在。 请帮助我如何获取登录用户的电子邮件地址。
【问题讨论】:
-
感谢您的回复。但我检查了所有地方的所有值,我只得到数字。
-
阿卜杜拉你在吗
标签: grails oauth facebook-oauth