是否有可能调用本地iOS设备只是一个网页(不是一个Web应用程序)的Facebook登录对话框? [英] Is it possible to call native ios Facebook login dialog from just a web page (not a web app)?

查看:191
本文介绍了是否有可能调用本地iOS设备只是一个网页(不是一个Web应用程序)的Facebook登录对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个使用原生Facebook登录iOS应用程序就好了。

然后,我们也有一个网站(应用程序基本上是一个优化的客户端吧),人们可以通过Facebook登录了。当他们在移动Safari浏览器打开我们的网站,它们被定向到Facebook页面来验证存在和它的作品,但..这还远远本地和用户有重新输入他们往往在IOS已经凭据。

所以可以将它有可能以某种方式发射系统FB认证只是一个网页(也许用一些巧妙的URL模式?),并取回令牌授权网站?


解决方案

艰难的方式
如这里所描述 http://aaronparecki.com/articles/ 2012/07/29/1 /的oauth2简单化#移动应用你会发现URL方案,从而引发对应用程序的授权原生iOS应用:

<$p$p><$c$c>fbauth://authorize?redirect_uri=[redirect_uri]&client_id=[client_id]&response_type=token

但是,如果你调用链接它不可能有一个重定向。你可以尝试破解了重定向,但也许你找不到出路。

A 安全的方法,以解决这个问题是使用SSO令牌,当他登录到你的应用程序验证用户,而旁边的Safari浏览器采取了重定向,使用自定义URL到您的APP,那些作为桥梁FB应用程序通过令牌存储在您的应用程序。 FB认证之后就可以直接重定向用户返回到Safari浏览器中的目标网页。正如@Lego认为很直接,可以通过深去FB所使用的自定义URL进行身份验证的另一种方式。

We have an ios app that uses native Facebook login just fine.

Then we also have a website (app is basically an optimized client for it) where people can login via Facebook too. When they open our website in mobile safari, they are directed to Facebook pages to authenticate there and it works, but.. it is still far from native and users have to retype credentials they often have in ios already.

So could it be possible to to somehow launch system fb authentication for just a web page (maybe using some clever URL schema?) and get granted token back to web?

解决方案

Difficult way As described here http://aaronparecki.com/articles/2012/07/29/1/oauth2-simplified#mobile-apps you could find URL scheme to trigger the native iOS app for app authorization:

fbauth://authorize?redirect_uri=[redirect_uri]&client_id=[client_id]&response_type=token

But if you call that link it's not possible to have a redirection. You could try to hack that redirection but maybe you could not find a way out.

A secure way to solve that problem is to use a SSO token to authenticate user on your App when he logs in, and next on Safari take a redirection, with a custom url to your APP, that do as bridge to FB App via Token stored in your APP. After FB authentication you can directly redirect user back to your landing page in Safari. As said by @Lego it's an alternative way to direct authenticate that could be made by going deep to custom URL used by FB.

这篇关于是否有可能调用本地iOS设备只是一个网页(不是一个Web应用程序)的Facebook登录对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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