# How to allow login of user through mobile number?

**URL:** <https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966>\
**Category:** Feature\
**Created:** [2014年十一月9日 10:41 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966 "2014-11-09T10:41:09Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![BobbyZopfan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bobbyzopfan/32/149374_2.png) [@BobbyZopfan](https://meta.discourse.org/u/BobbyZopfan)\
**Post date:** [2019年四月25日 05:02 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/42 "2019-04-25T05:02:06Z")

</div>

> [@zogstrip](#):
>
> Also, while you can easily change mobile phone number, they often are “_re-assigned_”, and you might end-up sending SMS to a complete different person.

In India at least, people rarely change their number. They change their handsets/devices, their operators, but not their numbers. (Number Portability is allowed in India and many other countries).

And in rare cases, when a user does happen to change his number, and opens any app which was attached with his old number, he is given OTP option (in which his old number will receive an OTP one last time); or security questions (in which he’ll be asked a few security questions). And this way he can effect the number change.

And this is practically happening in India daily.

---

<div class="post-metadata">

**Author:** ![BobbyZopfan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bobbyzopfan/32/149374_2.png) [@BobbyZopfan](https://meta.discourse.org/u/BobbyZopfan)\
**Post date:** [2019年四月25日 05:06 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/43 "2019-04-25T05:06:21Z")

</div>

> [@Falco](#):
>
> You can also put the burden on the forum owner to provide a valid SMS api key, like you need to provide a valid SMTP service (and soon a valid GCM api key).
> 
> If they want to provide mobile number login they need to add a valid SMS gateway service and pay for it (like e-mail).

👏👏👏👏👏👏

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2019年四月29日 01:38 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/44 "2019-04-29T01:38:59Z")

</div>

There is very wide spread precedent of “mobile phone number == identity”. This is how whatsapp works, they have 1.5 billion active users.

I think any experiment here should probably start with a plugin. It would be an interesting experiment and require some SMS inbound API integration.

How notifications would be handled though is a conundrum under a system like this.

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2019年四月29日 05:58 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/45 "2019-04-29T05:58:37Z")

</div>

> [@sam](#):
>
> require some SMS inbound API integration.

As part of the broad PWA Spec, browsers will be able to read one-time passwords from SMS using a new web API. This is coming this year to Chrome on Android, and was created to deal with cases like this.

[https://bugs.chromium.org/p/chromium/issues/detail?id=670299&q=owner%3Agoto%40chromium.org&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified](https://bugs.chromium.org/p/chromium/issues/detail?id=670299&q=owner%3Agoto%40chromium.org&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified)

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2019年四月29日 06:45 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/46 "2019-04-29T06:45:05Z")

</div>

Passwords through SMS is **not secure** though, e.g.

> **[Man's $1M Life Savings Stolen as Cell Number Is Hijacked](https://www.nbcbayarea.com/news/local/mans-1m-life-savings-stolen-in-cell-phone-scam/192416/)**
>
> Hackers are exploiting a system designed to make your financial, social media, and e-mail accounts safer. Security experts recommend everyone take action now to protect themselves.

Why would we want to support that?

---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2019年四月29日 06:54 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/47 "2019-04-29T06:54:42Z")

</div>

The uptake of email in India is rising too. In 2011 only 2% of the population had any form of email, as of last year it’s close to 1 in 6.

---

<div class="post-metadata">

**Author:** ![BobbyZopfan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bobbyzopfan/32/149374_2.png) [@BobbyZopfan](https://meta.discourse.org/u/BobbyZopfan)\
**Post date:** [2019年四月29日 07:04 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/48 "2019-04-29T07:04:27Z")

</div>

As we experience first hand in India in an average district, majority of these new users have to get someone to create an account on Gmail, just because they want to use WhatsApp and WhatsApp cannot be downloaded unless you’ve a playstore login ID (that’s =Google id).

And thereafter they never sign in to their Gmail. Not even once. For all purposes, they never know what’s their id is (far is password).

And sometime, for whatever reason, they happen to logout of their account on android, and they need to login once again in their Gmail account, they keep carrying their Mobiles to different known persons, requesting them to help _ **start** _ their mobile again. (they consider their mobile to be not usable if either WhatsApp stops, or calling stops)

---

<div class="post-metadata">

**Author:** ![charleswalter](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/charleswalter/32/116433_2.png) [@charleswalter](https://meta.discourse.org/u/charleswalter)\
**Post date:** [2019年四月29日 12:54 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/49 "2019-04-29T12:54:29Z")

</div>

We would be extremely happy to take place in any plugin experiment. How would we proceed to find someone to author it? Do we need to fund the SMS gateway for phone validation?

Please advise. I think it’s worthwhile testing it and see the uplift in registrations, as opposed to continue the debate. There’s a reason why Fcaebook / whatsapp offer it.

As far as notifications go, considering now that we have browser based notifications, at least there’s an alternative. Looking into occasional SMS notifications is not a bad idea, though I don’t think it’s the priority right now. I would expect it could start with a weekly or monthly reminder that there are new updates (if user hasn’t visited the community) and take users to their notifications page. Easy optout would be needed. Again, I wouldn’t include this in the plugin mvp.

---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2019年四月29日 13:38 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/50 "2019-04-29T13:38:07Z")

</div>

> [@BobbyZopfan](#):
>
> And thereafter they never sign in to their Gmail. Not even once. For all purposes, they never know what’s their id is (far is password).

Sorry, I should have clarified above - those figures aren’t ‘email accounts created in India’, that’s the number of unique mobile device users actively connecting to email devices every month.

Those figures are also against the total Indian population for 2018 of 1.344 billion. Measured against the 566 million internet users in that same period, the number of active email users is just over 35%.

---

<div class="post-metadata">

**Author:** ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)\
**Post date:** [2019年四月29日 13:56 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/51 "2019-04-29T13:56:47Z")

</div>

ProCourse is actually in the middle of a project like this for a client that is willing to let us open-source the work.

[https://github.com/procourse/discourse-sms-authentication](https://github.com/procourse/discourse-sms-authentication)

The idea is not to use SMS as a password, but to simply replace the sending of emails with sending SMS through Twilio, Africa’s Talking, and Braze campaigns. The first two are currently implemented and seem to be working well. The last is currently in development.

The concept is to hide the email address on sign-up and fill it in behind the scenes with addresses that mimic the phone number: [phone+555-555-5555@example.com](mailto:phone+555-555-5555@example.com). That way Discourse still works with emails if it needs.

But then we tie into specific events (user creation, password update, PM sent, mentions, etc…) and send SMS notifications on top of the email. But since the email is going to the aliased email, the user never has to deal with it.

---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2019年四月29日 13:58 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/52 "2019-04-29T13:58:30Z")

</div>

What if a user wants to swap from using SMS authentication to email-based? Do you have plans to cater for that?

---

<div class="post-metadata">

**Author:** ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)\
**Post date:** [2019年四月29日 14:00 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/53 "2019-04-29T14:00:22Z")

</div>

Not currently. This plugin was designed as a complete swap. The main audience being African countries where most people don’t have an email address but most everyone has a smartphone.

---

<div class="post-metadata">

**Author:** ![charleswalter](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/charleswalter/32/116433_2.png) [@charleswalter](https://meta.discourse.org/u/charleswalter)\
**Post date:** [2019年四月29日 14:27 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/54 "2019-04-29T14:27:08Z")

</div>

so what requirements would a forum provider have if they want to integrate? Create their own Twilio and/or Braze account?

---

<div class="post-metadata">

**Author:** ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)\
**Post date:** [2019年四月29日 14:43 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/55 "2019-04-29T14:43:22Z")

</div>

Install the plugin, create a Twilio account, and fill out the site settings for it. It’ll require the API Key for Twilio and the email domain to use for the aliased email account.

---

<div class="post-metadata">

**Author:** ![Hector](https://avatars.discourse-cdn.com/v4/letter/h/43a26b/32.png) [@Hector](https://meta.discourse.org/u/Hector)\
**Post date:** [2019年四月29日 15:13 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/56 "2019-04-29T15:13:17Z")

</div>

Has anyone considered using [Facebook’s account kit](https://developers.facebook.com/docs/accountkit/faq)? It’s a passwordless login method that works with e-mail or phone number. I think it’s free up to 100.000 sms per month.

---

<div class="post-metadata">

**Author:** ![Natasha\_LaBranche](https://avatars.discourse-cdn.com/v4/letter/n/a5b964/32.png) [@Natasha\_LaBranche](https://meta.discourse.org/u/Natasha_LaBranche)\
**Post date:** [2019年七月1日 17:51 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/57 "2019-07-01T17:51:15Z")

</div>

@joebuhlig 我们能否就这项工作沟通一下？请打电话或发邮件。

---

<div class="post-metadata">

**Author:** ![BobbyZopfan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bobbyzopfan/32/149374_2.png) [@BobbyZopfan](https://meta.discourse.org/u/BobbyZopfan)\
**Post date:** [2019年十月23日 05:01 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/58 "2019-10-23T05:01:01Z")

</div>

> [@Hector](#):
>
> 有人考虑过使用 [Facebook 的账户套件](https://developers.facebook.com/docs/accountkit/faq) 吗？

他们已停止该服务。

---

<div class="post-metadata">

**Author:** ![nadodi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nadodi/32/116440_2.png) [@nadodi](https://meta.discourse.org/u/nadodi)\
**Post date:** [2020年九月8日 05:23 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/59 "2020-09-08T05:23:04Z")

</div>

大家好：

我想重新提起这个话题，看看这项功能请求是否有任何进展或更新，特别是来自 @joebuhlig 的反馈。

背景：我们在印度泰米尔纳德邦与农业社区合作（其中大多数是小农户）。电子邮件的使用几乎不存在，而手机则非常普及。

如果能将基于手机的身份验证和通知功能添加到 Discourse 出色的论坛功能中，那就太好了。

提前感谢。

---

<div class="post-metadata">

**Author:** ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)\
**Post date:** [2020年九月10日 16:31 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/60 "2020-09-10T16:31:06Z")

</div>

抱歉。我这边没什么可报告的。该项目未能完成。

---

<div class="post-metadata">

**Author:** ![nadodi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nadodi/32/116440_2.png) [@nadodi](https://meta.discourse.org/u/nadodi)\
**Post date:** [2020年九月15日 02:01 UTC](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966/61 "2020-09-15T02:01:37Z")

</div>

哦，那太遗憾了。使用电子邮件别名似乎是个不错的变通办法。感谢更新。

[上一頁](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966.md?page=2)

[下一頁](https://meta.discourse.org/t/how-to-allow-login-of-user-through-mobile-number/21966.md?page=4)
