针对移动应用的电话号码,根据设计验证 [英] Phone number based Devise authentication for mobile apps

查看:232
本文介绍了针对移动应用的电话号码,根据设计验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们都知道,设计用于在轨道上实施验证的基于应用的事实标准。

We all know that Devise is de facto standard for implementing authentication on rails based apps.

在默认情况下,它使用电子邮件作为ID,也可以让你使用用户名称来代替。它还具有可确定模块,使您可以通过发送电子邮件,并通过点击链接以验证您的电子邮件确认的电子邮件地址。

By default it uses email as ID but also allows you to use usernames instead. It also has "Confirmable" module which lets you confirm the email address by sending an email and clicking through the link to verify your email.

我一直在寻找的电话号码类似的东西 - 基本上接受电话号码作为主要的ID,而不是电子邮件,然后经由像Twilio发送AUTH code作为短信到用户的号码确认电话号码,然后让用户通过输入code(或甚至让通过生成的链接,用户点击确认,就像他们用电子邮件做)确认

I was looking for something similar for phone numbers--basically accepting phone numbers as primary ID instead of emails, and then confirm the phone number by sending an auth code as SMS message to the user's number via something like Twilio, and then let the user confirm it by entering the code (or even let the user click through a generated link to verify just like they do with emails)

我之所以期待那里是这个功能的受欢迎色器件模块,是因为它好像大多数移动社交应用接受电话号码和时下确认号码。有一定有别人谁认为这是这个问题,开源的模块。不过,我找不到任何流行的。其实要precise,这里有我在此发现的仅有的三个相关的链接:

The reason I was expecting there to be a popular devise module for this functionality was because it seems as if most mobile social apps accept phone numbers and confirm the number nowadays. There's gotta be someone who thought this was a problem and open-sourced a module for this. However I couldn't find any popular ones. Actually to be precise, here are the only three relevant links I've found on this:

  • https://github.com/giano/devise_sms_activable
  • https://github.com/baranov-sv/devise_sms_confirmable
  • Rails register User using phone number and confirmation

他们没有导致工作液(我试过devise_sms_activable但它并不适用于轨道4的工作,再加上我警惕低一些分)所以我想问是否有任何可行的解决方案这个。我缺少的东西吗?已经这个话题被带到了设计开发者社区中?我很好奇的解决方案,但如果没有,我至少AP preciate为什么这是不容易得到任何回答。

None of them leads to a working solution (I've tried devise_sms_activable but it doesn't work for rails 4, plus I'm wary of the low number of stars) So I wanted to ask if there's any viable solution to this. Am I missing something? Has this topic been brought up among the Devise developer community? I'm curious about the solution but if there is none, I would at least appreciate any answer on why this is not readily available.

[更新]

我想问题可能是一个有点误导。虽然我可以建立它自己,我不喜欢重新发明轮子。
基本上我这个问题的意图是:

I think the question might have been a bit misleading. While I can just build it myself, I don't like to re-invent the wheel. Basically my intention with this question was:


  1. 如果有,这是否(像所有的模块,如可证实,token_authentcatable等也许甚至没有一个设计模块,它可能是一个完全不同的事情)
  2. 任何包
  3. 或者,如果不存在这样的$ P $对内置溶液,为什么没有一个。我只是不能COM prehend为什么没有这样的解决方案时,每个人似乎都这样做,我可以找到。

当我得到的答案要么1号或2,我会欣然接受。谢谢!

I will gladly accept when I get an answer to either #1 or #2. Thanks!

推荐答案

我已经研究过之前... ...但项目要求改变...所以所有的的制定维基

i've looked into that before... but the project requirements changed... so all of the following are relative links found on the devise wiki

  • this how to allows you to sign in and authenticate with different fields other than the email address
  • A Simple Token Authentication Service for Mobile Devices Using Rails 3 and Devise.

您可以结合使用previous TUTS像<一个有些事href=\"https://www.twilio.com/docs/ruby/install/?utm_source=stackoverflow&utm_medium=social&utm_campaign=stackdocsupdate\"相对=nofollow> Twilio 发送创建的自定义身份验证令牌和验证有电话号码的用户以外的其他邮件。

you can use the previous tuts in conjunction with some thing like Twilio to send the created custom auth token and authenticate user with phone number other than email.

[更新]

既然你提到一个已经工作的解决方案,我认为这是你在找什么。 活动模型OTP 并的这个博客帖子它是新的,我没有试驾它的机会:D

since you mentioned an already working solution, I think this is what you are looking for. Active Model OTP and this blog post it's new and i didn't have the chance to test drive it :D

我还发现双因素身份验证设计扩展

这篇关于针对移动应用的电话号码,根据设计验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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