【发布时间】:2020-10-26 15:48:23
【问题描述】:
只有在 Facebook Developer 应用程序配置中禁用 "Require App Secret" 选项时,我才能使用 Facebook 登录到我的 SpringBoot 应用程序。
当启用额外的(推荐的)安全检查时,我得到一个错误
org.springframework.security.oauth2.core.OAuth2AuthenticationException: [invalid_user_info_response]
An error occurred while attempting to retrieve the UserInfo Resource: Error details: [UserInfo Uri:
https://graph.facebook.com/me?fields=id,name,email, Error Code: {message=API calls from the server
require an appsecret_proof argument, type=GraphMethodException, code=100, fbtrace_id=xxxx}]
很明显,Spring Security 尝试访问 Facebook(调用 https://graph.facebook.com/me?fields=id,name,email)以检索经过身份验证的用户,但未能传递额外参数 appsecret_proof。
目前尚不清楚(在深入研究 SpringSecurity 文档和论坛之后)我如何让 Spring 添加额外的令牌。
【问题讨论】:
-
在 repo github.com/spring-projects/spring-security-oauth 中搜索“证明”一无所获,所以他们可能还没有实现?
-
当你使用Spring Security's Facebook sample时你会得到什么行为?
-
@CBroe,您链接到的项目已弃用,支持已移至github.com/spring-projects/spring-security。
-
确实,我不使用 Spring Social 或 Spring Security Oauth,两者都已弃用。我已经使用 Spring Security 集成了 Facebook 登录,除非我禁用“需要应用程序密码”选项,否则它工作正常
标签: spring-boot facebook spring-oauth2