【发布时间】:2020-09-28 16:45:33
【问题描述】:
我想在带有 spring boot 的 mu Web 应用程序中使用 oauth2 和 facebook,这是为此目的的配置:
spring:
security:
oauth2:
client:
registration:
google:
clientId: clientIdValue
clientSecret: clientSecretValue
redirectUri: "https://www.example.com/oauth2/callback/{registrationId}"
scope:
- email
- profile
facebook:
clientId: clientIdValue
clientSecret: clientSecretValue
redirectUri: "https://www.example.com/oauth2/callback/{registrationId}"
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,verified,is_verified,picture.width(250).height(250)
server:
port: 443
ssl:
key-store-type: PKCS12
key-store: classpath:keystore/sslkeystore.p12
key-store-password: passwordValue
key-alias: tomcat
enabled-protocols:
- TLSv1
- TLSv1.1
- TLSv1.2
Google 身份验证工作正常,但在 facebook 中重定向到我的网站后出现此错误:
An error occurred while attempting to retrieve the OAuth 2.0 Access Token Response: I/O error on POST request for \"https://graph.facebook.com/v3.0/oauth/access_token\": Remote host closed connection during handshake; nested exception is javax.net.ssl.SSLHandshakeException: Remote host closed connection during
【问题讨论】:
-
您是否尝试研究错误消息...? stackoverflow.com/questions/21245796/…
-
@CBroe,是的,我这样做了,但没有解决问题。
标签: facebook spring-boot facebook-graph-api oauth-2.0 spring-security-oauth2