只有当我在Facebook应用程序配置中禁用"Require App Secret"选项时,我才能使用Facebook登录到我的"Require App Secret"应用程序。
当启用额外(推荐的)安全检查时,我会得到一个错误。
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}]很明显,Security试图访问Facebook (调用https://graph.facebook.com/me?fields=id,name,email)来检索经过身份验证的用户,但它未能传递额外的参数appsecret_proof。
现在还不清楚(在深入了解SpringSecurity文档和论坛之后)如何让Spring添加额外的令牌。
发布于 2022-01-05 23:40:41
我有一个非常类似的情况-我无法登录到我的应用程序使用facebook用户帐户。
首先,确保给定的客户端id和机密id是正确的(有时它可能与您的其他项目混淆)。如果您确信输入的数据没有问题,我将首先检查可用的许可证。因此,打开facebook登录插件面板(您应该在屏幕右侧有一个选项卡)。

就我的情况而言,以下配置就足够了:

更重要的是,检查可用权限和功能:

需要public_profile访问才能提取想要登录到您的网站的用户的基本信息。此外,也值得添加一个电子邮件请求。

还可以检查facebook客户端的配置,它允许您获取用户令牌:
spring:
security:
oauth2:
client:
registration:
facebook:
clientId: your-client-id
clientSecret: your-client-secret
redirectUri: "{baseUrl}/api/oauth2/callback/{registrationId}" # Note that facebook now mandates the use of https redirect URIs, so make sure your app supports https in production
scope:
- email
- public_profile
provider:
facebook:
authorizationUri: https://www.facebook.com/v3.0/dialog/oauth
tokenUri: https://graph.facebook.com/v3.0/oauth/access_token
userInfoUri: https://graph.facebook.com/v3.0/me?fields=id,first_name,middle_name,last_name,name,email在我的例子中,上述配置足以让用户在外部网站上授权自己。
https://stackoverflow.com/questions/64540494
复制相似问题