创建一个自定义的Facebook登录表单 [英] Creating a custom Facebook login form

查看:65
本文介绍了创建一个自定义的Facebook登录表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道是否可以为Facebook连接创建我们自己的用户界面,而不必使用FBLoginDialog吗?

如果是,怎么办?

如果没有,我可以将FBLoginDialog格式化为我想要的外观,就像FBStreamDialog(贴到墙上的开机自检消息)吗?

任何建议将不胜感激.

解决方案

FB授权过程基于OAuth,整个想法是用户从不必须给您他们的用户名或密码.如果实现自己的登录界面,则意味着用户键入的所有信息都将通过您的代码传递,这意味着您破坏了OAuth的意图,即使您可以使用它(这也不是一件容易的事)./p>

另一种方法是在从网络上加载FB网页后,通过在FB网页上运行一些Javascript代码来修改页面的外观.(您可以使用-[UIWebView stringByEvaluatingJavaScriptFromString] 进行此操作).尽管如此,像taskino一样,我也不认为这是一个好主意,因为主要是用户应该对就是FB页面,而他们没有在其中键入信息.

iPhone用户实际上不可能确保您没有伪造整个Web视图,但至少您不应该尝试使它们可疑.

Does anyone know if it is possible to create our own user interface for Facebook connect instead of having to use FBLoginDialog?

If YES, how?

IF NO, can I format FBLoginDialog to have the look that I want just like the FBStreamDialog (POST message to wall)?

Any suggestion would be highly appreciated.

解决方案

The FB authorization process is based on OAuth, and the whole idea is that users should never have to give you their user name or password. If you implement your own login interface, that means all information users type in is passed through your code, and that would mean that you break the intention of OAuth, even if you could get it to work (which is not very easy).

An alternative is to modify the appearance of the page by running some Javascript code on the FB web page after it has been loaded from the network. (You'd do that using -[UIWebView stringByEvaluatingJavaScriptFromString]) But even though this is possible, like taskinoor I don't think it's a good idea, because the main thing is that users should feel confident that it the FB page and nothing else that they are typing their info into.

It's in fact not possible for iPhone users to be sure that you haven't faked the whole web view, but at least you shouldn't try to make them suspicious.

这篇关于创建一个自定义的Facebook登录表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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