使用我的IBM Worklight Web应用程序登录Facebook [英] Login with Facebook with my IBM Worklight web application

查看:91
本文介绍了使用我的IBM Worklight Web应用程序登录Facebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用IBM Worklight创建了一个简单的Web应用程序. 现在,我正在尝试使用 https://developers.facebook使用Facebook api. com/docs/guides/mobile/web/#samples 教程 用户可以使用其Facebook ID登录.

I created a simple web application using IBM Worklight. Now, I am trying to use Facebook api using https://developers.facebook.com/docs/guides/mobile/web/#samples tutorial Where a user can login with their Facebook id.

为了设置此功能,我需要提供我的Web应用程序的siteUri,因此我将Web环境添加到了我的应用程序中并获得了应用程序URI作为 http://[IP地址]:8080/apps/services/www/zShop/mobilewebapp/

In order to set up this functionality, I need to give the siteUri of my web app so i added web environment to my app and got app URI as http://[Ip Address]:8080/apps/services/www/zShop/mobilewebapp/

但是,当我运行应用程序时,出现此错误

But, when I run the application, I get this error

API错误代码:191 API错误描述: 指定的URL不属于应用程序错误消息: redirect_uri无效:应用程序配置不允许给定的URL.

API Error Code: 191 API Error Description: The specified URL is not owned by the application Error Message: Invalid redirect_uri: Given URL is not allowed by the Application configuration.

不确定出什么问题,请帮忙

Not sure what is wrong, please help

推荐答案

您需要将应用托管在人类可读的域(例如example.com)上,而不是通过文字IP地址访问的应用.如果您没有域,则可以尝试在笔记本电脑/台式机的hosts文件中添加一个条目,这样就不必使用IP地址(我没有在FB应用程序中尝试过此操作).

You'll need to host your app on a human-readable domain (eg. example.com) instead of one reached by a literal IP address. If you don't have a domain, you could try adding an entry in your laptop/desktop's hosts file so you don't have to use the IP address (I haven't tried this with FB apps).

您还可以从Heroku获得免费的虚拟主机.它是免费的,因为它是入门级软件包托管.这里有一个很好的Heroku教程: https://devcenter.heroku.com/articles/facebook

You can also get free webhosting from Heroku. It's free because it's starter-package level hosting. There's a good Heroku tutorial here: https://devcenter.heroku.com/articles/facebook

因此,请确保您可以使用域名(例如example.com)在浏览器中加载应用程序.

So ensure you can load the app in a browser using a domain name (eg. example.com).

然后确保您的应用程序设置已配置此域名:

Then make sure your app settings has this domain name configured:

应用信息中心>基本>应用域

然后按照该教程的第1步"中所述输入您的域.

Then enter your domain as written in "Step 1" of that tutorial.

这篇关于使用我的IBM Worklight Web应用程序登录Facebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆