Rails的设计OmniAuth的Facebook登录iOS的距

Rails的设计OmniAuth的Facebook登录iOS的距

本文介绍了Rails的设计OmniAuth的Facebook登录iOS的距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一个坚实的解决了这个问题,并在问题类型的其中我predicament比赛,但不完全是。

I've been searching for a solid solution to this problem, and came across this SO question which kind of matches my predicament, but not exactly.

目前,我有我的iPhone应用程序通过基本验证我的Rails API认证。这只是你的简单,运行的设施,工厂设计AUTH包。然后我也跟着成立omniauth Facebook的为设计出说明,并得到了在浏览器端的工作。

Currently I have my iPhone application authenticating with my Rails API via Basic Auth. It's just your simple, run-of-the-mill devise auth package. I then followed the instructions to set up omniauth-facebook for devise and got that working on the browser side.

我无法弄清楚如何做的部分是如何在iPhone上接收方(通过Facebook的iOS版SDK)令牌发送到服务器。我希望服务器检查用户表,看看是否能Facebook的用户已经签约了,并为他建立一个帐户,如果他没有。然后,我在想服务器会生成一个随机的密码,并将其发送回客户端设备,这样我可以保持我的基本相同的认证策略。这是实现单点登录的Web应用程序和iPhone应用程序的正确方法?如何将一个去修改服务器端软件包通过从手机发出的令牌来支持验证?

The part I can't figure out how to do is how to send the token received on the iPhone side (via the Facebook iOS SDK) to the server. I want the server to check the users table to see if that facebook user has signed up, and create an account for him if he hasn't. Then, I was thinking the server would generate a random password and send it back to the client device so that I could keep my same basic authentication strategy. Is this the proper way to implement single sign on for a web app and iPhone app? How would one go about modifying the server side packages to support authentication via a token sent from the phone?

推荐答案

您可能想看看这里:

它看起来像一个相对简单的方式使用Rails /设计和iOS工作。我肯定计划在我的下一个项目使用它。

It looks like a relatively painless way to work with Rails / Devise and iOS. I definitely plan on using it in my next project.

这篇关于Rails的设计OmniAuth的Facebook登录iOS的距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 06:07