移动Cordova / phonegap facebook登录没有插件,只使用网址 [英] Mobile Cordova / phonegap facebook login without plugin, using only url

查看:104
本文介绍了移动Cordova / phonegap facebook登录没有插件,只使用网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此登录系统在桌面客户端上正常工作。用户重定向到Facebook以允许该应用,然后重定向到我的网站:

 https://graph.facebook。 com / oauth / authorize?client_id =+ client_id +& redirect_uri =+ redirect_uri +& scope =+ scope;但是,在cordova / phonegap中,该网址已发送,但是在chrome中收到此错误:

p>

http:// undefined / proxy / https://graph.facebook.comhttps://www.facebook.com/dialog/oauth?client_id = 1567960953444888& redirect_uri = this_is_correct%2Ffacebook_login.php& scope = user_friends& state = 1 net :: ERR_NAME_NOT_RESOLVED



我的伺服器登入我只需要输出成功登录给用户。所以,即使实际登录不工作至少应该输出此消息。

解决方案

我认为这可能是由两件事造成的。



可能由于白名单而无法解析网址。如果您不使用此插件,并使用通配符进行测试,请使用此插件



https://github.com/apache/cordova-plugin-whitelist



如果没有,桌面登录使用某种饼干?也许你必须使用它。


This login system is working perfectly on desktop clients. The user is redirect to facebook to allow the app and then redirected to my website:

"https://graph.facebook.com/oauth/authorize?client_id=" + client_id + "&redirect_uri=" + redirect_uri + "&scope=" + scope; 

However, in cordova/phonegap, that url is sent but this error is received in chrome:

http://undefined/proxy/https://graph.facebook.comhttps://www.facebook.com/dialog/oauth?client_id=1567960953444888&redirect_uri=this_is_correct%2Ffacebook_login.php&scope=user_friends&state=1 net::ERR_NAME_NOT_RESOLVED

My server login is made so that I just need to output "success login" to the user. So, even if the actual login wasn't working at least there should be output of this message. Any wonder on what might be happening?

解决方案

I think it can be caused by two things.

Maybe the url can't be resolved due to whitelists. Use this plugin if you aren't using it, and use wildcards just for test

https://github.com/apache/cordova-plugin-whitelist

If not, are the desktop login using some kind of cookies? Maybe you have to use it.

这篇关于移动Cordova / phonegap facebook登录没有插件,只使用网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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