Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The problem when Chinese user enabling GitHub two-factor authentication via SMS
今天发现 GitHub 有两步验证的功能,于是打算开启,可是悲剧的是,到了填写手机号的时候,发现没有 China 的选项。
于是我尝试了下修改网页源代码,添加了 `<option value="+86">China +86</option>` 再填手机号,居然就收到短信了。
后来有点不放心,还是给 https://github.com/contact 发了个反馈,然后收到回信说由于某些国家的短信发送成功率无法保证,所以没有开启两步验证功能。
不过在我这段时间的使用过程中,还是挺稳定的,每次都能收到短信。
大家如果也需要开启两步验证,最好把 Recover code 也记下来吧,避免以后短信收不到。
## Massage sent to GitHub Contact
I found that the country code field has no option for Chinese users when I was enabling two-factor authentication via SMS:
```html
<select class="js-country-code-select js-2fa-confirm" autocomplete="tel-country-code" name="countrycode">
...
<option value="+257">Burundi +257</option>
<option value="+855">Cambodia +855</option>
<option value="+1">Canada +1</option>
<option value="+238">Cape Verde +238</option>
<option value="+1345">Cayman Islands +1345</option>
<option value="+61">Christmas Island +61</option>
<option value="+61">Cocos +61</option>
<option value="+243">Congo, Dem Rep +243</option>
<option value="+385">Croatia +385</option>
<option value="+357">Cyprus +357</option>
<option value="+420">Czech Republic +420</option>
<option value="+45">Denmark +45</option>
...
</select>
```
I am wondering if this is a bug?
BTW, I have fixed the problem by adding `<option value="+86">China +86</option>`, and it works because I have received the message from GitHub!
## Email received from GitHub staff
Hi Xcat,
Due to the importance of two factor authentication messages we want to be extremely confident in the delivery rates before we enable one time password delivery via SMS since heavy delays render the one time password useless and being unable to receive one prevents you from accessing your account.
This is the reason that SMS is not presented as an option in some countries. As our provider advises us on the delivery status in specific countries we'll revise the list:
https://help.github.com/articles/countries-where-sms-authentication-is-supported/
Thanks,
James
@wawaa
Copy link

wawaa commented Apr 1, 2019

长沙联通+1

@gonejack
Copy link

gonejack commented Apr 12, 2019

可以的,广州移动。主力还是 Google 身份验证器比较安全。

@morningstarwang
Copy link

morningstarwang commented Apr 15, 2019

北京联通+1

@lupus721
Copy link

lupus721 commented May 5, 2019

哈哈,好骚的操作,北京移动,ok,可以用

@Ansen
Copy link

Ansen commented May 5, 2019

成都电信成功开通

@lhp9916
Copy link

lhp9916 commented Aug 24, 2019

武汉移动开通成功,感谢

@peakingTony
Copy link

peakingTony commented Sep 7, 2019

北京移动成功开通

@YK-Unit
Copy link

YK-Unit commented Dec 17, 2019

广州移动成功开通

@lindexi
Copy link

lindexi commented Mar 12, 2020

多谢大佬

@Poseiden
Copy link

Poseiden commented Mar 28, 2020

大佬666

@hui-shao
Copy link

hui-shao commented Apr 1, 2020

2020.04.01

服务商 中国移动
亲测可用

感谢分享

@tensorchen
Copy link

tensorchen commented May 2, 2020

👍

@jlzhou
Copy link

jlzhou commented May 7, 2020

天津联通 +1

@czzonet
Copy link

czzonet commented May 9, 2020

You little genius!

@BH-M87
Copy link

BH-M87 commented Jun 18, 2020

amazing. Unicom in Wuhan.

@FlurryLi
Copy link

FlurryLi commented Sep 3, 2020

鬼才啊

@alzee
Copy link

alzee commented Nov 7, 2020

湖北联通OK。
附上 猴子请来的救兵_ 的 js 版本
这和当年 outlook 申请 live 和 msn 后缀异曲同工啊,怎么没想到。

@HavenLin
Copy link

HavenLin commented Dec 9, 2020

汕尾移动+1 谢谢

@AllenAnZifeng
Copy link

AllenAnZifeng commented Dec 17, 2020

中国·电信+1谢谢大佬!

@sjx782392329
Copy link

sjx782392329 commented Dec 22, 2020

中国联通 + 10086~

@onewesong
Copy link

onewesong commented Jan 13, 2021

中国电信+1,感谢分享

@han1254
Copy link

han1254 commented Mar 11, 2021

You are my hero!!!!!!!!!

@baurine
Copy link

baurine commented Mar 15, 2021

联通 +1。感谢!

添加了 <option value="+86">China +86</option>

也可以直接把其它选项的 value 改成 "+86"。

@lilinghai
Copy link

lilinghai commented Mar 22, 2021

Thanks

@liualexiang
Copy link

liualexiang commented Mar 25, 2021

Thanks, it works

@Abirdcfly
Copy link

Abirdcfly commented Jul 1, 2021

北京移动 +1

@joyous-coder
Copy link

joyous-coder commented Jul 15, 2021

北京联通+1

@joyous-coder
Copy link

joyous-coder commented Jul 15, 2021

收藏了

@zslwyuan
Copy link

zslwyuan commented Oct 3, 2021

这都行服了。。。广州移动+1

@quanyuqi
Copy link

quanyuqi commented Jan 10, 2022

nb, 学到了,膜拜大佬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment