我正在尝试集成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);
}我得到以下错误:
{
"error": {
"message": "redirect_uri isn't an absolute URI. Check RFC 3986.",
"type": "OAuthException",
"code": 191
}
}redirecct_uri应该是什么?我怎么才能修复它呢?有谁能帮忙吗?
谢谢
发布于 2013-07-12 05:39:19
您的redirect_uri必须是带有协议(http(s)://)、域、路径等的完全限定的URL。
如果您正在编写桌面应用程序,根据How to login / authenticate facebook without browser for desktop application in C#的说法,不存在对桌面应用程序的显式支持,但是有一个解决方法(在这个问题中概述了它)。
https://stackoverflow.com/questions/17603811
复制相似问题