首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在使用jsf登录facebook时,获取redirect_uri不是绝对的URI错误

在使用jsf登录facebook时,获取redirect_uri不是绝对的URI错误
EN

Stack Overflow用户
提问于 2013-07-12 05:24:54
回答 1查看 6.9K关注 0票数 4

我正在尝试集成facebook登录到我的网站。以下是我的部分代码:

代码语言:javascript
运行
复制
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);
}

我得到以下错误:

代码语言:javascript
运行
复制
{
  "error": {
    "message": "redirect_uri isn't an absolute URI. Check RFC 3986.",
    "type": "OAuthException",
    "code": 191
  }
}

redirecct_uri应该是什么?我怎么才能修复它呢?有谁能帮忙吗?

谢谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-07-12 05:39:19

您的redirect_uri必须是带有协议(http(s)://)、域、路径等的完全限定的URL。

如果您正在编写桌面应用程序,根据How to login / authenticate facebook without browser for desktop application in C#的说法,不存在对桌面应用程序的显式支持,但是有一个解决方法(在这个问题中概述了它)。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17603811

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档