我正在尝试将 facebook 登录与我的网站集成。这是我的代码的一部分:
public void socialConnect() throws Exception {
Properties props = System.getProperties();
props.put("graph.facebook.com.consumer_key", "561379830565954");
props.put("graph.facebook.com.consumer_secret", "883e8d729d0358b4040fbffa762d832d");
props.put("graph.facebook.com.custom_permissions", "publish_stream,email,user_birthday,user_location,offline_access");
SocialAuthConfig config = SocialAuthConfig.getDefault();
config.load(props);
manager = new SocialAuthManager();
manager.setSocialAuthConfig(config);
ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
String successURL = externalContext.getRequestContextPath() + "/socialLoginSuccess.xhtml";
String authenticationURL = manager.getAuthenticationUrl(providerID, successURL);
FacesContext.getCurrentInstance().getExternalContext().redirect(authenticationURL);
}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
{
"error": {
"message": "redirect_uri isn't an absolute URI. Check RFC 3986.",
"type": "OAuthException",
"code": 191
}
}
Run Code Online (Sandbox Code Playgroud)
redirectct_uri 应该是什么?我该如何修复它有人可以帮忙吗?
谢谢
您redirect_uri必须是包含协议 ( http(s)://)、域、路径等的完全限定 URL 。
如果您正在编写桌面应用程序,根据如何在没有浏览器的情况下在 C# 桌面应用程序中登录/验证 facebook 没有对桌面应用程序的明确支持,但是有一个解决方法(并且在该问题中进行了概述)。
| 归档时间: |
|
| 查看次数: |
6825 次 |
| 最近记录: |