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
@knight42

This comment has been minimized.

Copy link

knight42 commented Apr 19, 2016

Thanks! How do you come up with adding an option? It seems unreasonable, but it just works!

@taroxd

This comment has been minimized.

Copy link

taroxd commented May 15, 2016

Amazing!

@kenshinji

This comment has been minimized.

Copy link

kenshinji commented Jun 1, 2016

AWESOME!!! I thought they had banned receiving authentication code from cellphone number of China.

@hilaily

This comment has been minimized.

Copy link

hilaily commented Nov 18, 2016

AWESOME!!! Thank you!!!

@sinchang

This comment has been minimized.

Copy link

sinchang commented May 5, 2017

实用 感谢

@flyher

This comment has been minimized.

Copy link

flyher commented Jan 2, 2018

@xcatliu
已经好几年都断断续续收不到短信了。。。你的居然行?哪个号段呢?

@henrayluo

This comment has been minimized.

Copy link

henrayluo commented Jan 19, 2018

i can not receive the sms code [北京移动] -_- but thanks.

@ryan4yin

This comment has been minimized.

Copy link

ryan4yin commented Jan 22, 2018

显然我中国电信也不行。。

@lgh06

This comment has been minimized.

Copy link

lgh06 commented Feb 1, 2018

不错。会玩。管用。

@mage0535

This comment has been minimized.

Copy link

mage0535 commented Mar 19, 2018

电信表示不可以

@hstdt

This comment has been minimized.

Copy link

hstdt commented Jul 19, 2018

我的移动号可以收到,赞一个。

@Pircate

This comment has been minimized.

Copy link

Pircate commented Aug 20, 2018

联通没问题,点个赞

@speedoholic

This comment has been minimized.

Copy link

speedoholic commented Aug 22, 2018

非常好

@laiwei

This comment has been minimized.

Copy link

laiwei commented Nov 13, 2018

good job:)

@687766616e

This comment has been minimized.

Copy link

687766616e commented Nov 19, 2018

china unicom CANTTTTTTTT t.t
china mobile OK

@modyuan

This comment has been minimized.

Copy link

modyuan commented Dec 27, 2018

居然还有这种操作!!
我的联通可以!

@Tobyyyyyyyyyy

This comment has been minimized.

Copy link

Tobyyyyyyyyyy commented Jan 24, 2019

联通+1

@Eurus-Holmes

This comment has been minimized.

Copy link

Eurus-Holmes commented Jan 27, 2019

移动+1

@dieyidezui

This comment has been minimized.

Copy link

dieyidezui commented Jan 31, 2019

移动+1

@sayhi987

This comment has been minimized.

Copy link

sayhi987 commented Feb 15, 2019

上海移动+1

@tequlia2pop

This comment has been minimized.

Copy link

tequlia2pop commented Feb 17, 2019

四川移动+1

@tcitry

This comment has been minimized.

Copy link

tcitry commented Mar 26, 2019

这脑洞,服了!

@wawaa

This comment has been minimized.

Copy link

wawaa commented Apr 1, 2019

长沙联通+1

@gonejack

This comment has been minimized.

Copy link

gonejack commented Apr 12, 2019

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

@morningstarwang

This comment has been minimized.

Copy link

morningstarwang commented Apr 15, 2019

北京联通+1

@lupus721

This comment has been minimized.

Copy link

lupus721 commented May 5, 2019

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

@Ansen

This comment has been minimized.

Copy link

Ansen commented May 5, 2019

成都电信成功开通

@lhp9916

This comment has been minimized.

Copy link

lhp9916 commented Aug 24, 2019

武汉移动开通成功,感谢

@peakingTony

This comment has been minimized.

Copy link

peakingTony commented Sep 7, 2019

北京移动成功开通

@YK-Unit

This comment has been minimized.

Copy link

YK-Unit commented Dec 17, 2019

广州移动成功开通

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.