I am trying to use a Twilio phone number for Apple's two factor authentication, but when I set up the phone number on Apple's site the initial verification SMS is never received by the Twilio number. I have confirmed that Apple is able to send the text to a Google Voice number. I have also confirmed with Apple support that the message sent is a standard SMS. Is there something on Twilio's side preventing receiving the message?
From your MacGo to Apple menu > System Preferences, then click Apple ID. Click Password & Security > Get Verification Code.
You can't bypass 2FA. If you use security questions with your Apple ID, or if you don't have access to a trusted device or phone number, go to iforgot.apple.com. Then you can unlock your account with your existing password or reset your password.
Go to Settings > Security > Two-factor authentication and click on Manage. Click Change next to your phone number to update it. You will receive a text message with a verification code.
As a followup to ryechus' answer, I requested this functionality and was still not able to receive 2fa codes from apple in Twilio. Their support said:
the unfortunate limitation you're likely facing is that I have know Apple to prevent verification codes from being sent to virtual phone numbers.
Some services review the offered number and only send verification SMS to phone numbers associated with genuine handsets as a measure to protect against fraud.
Unfortunately, regardless of the Twilio configuration, in my experience Apple will not delivery verification messages to Twilio.
Interestingly, it does work with google voice.
This is actually by design. By default, Twilio long code numbers can't receive SMS messages from short code numbers. Look for the section titled "Are you expecting to receive SMS from a short code?" at the following link. https://support.twilio.com/hc/en-us/articles/223133447-Not-Receiving-Incoming-SMS-and-MMS-Messages-on-Twilio-Phone-Number
When I asked this question the functionality wasn't available at all, but now the feature can be requested. There are caveats. https://support.twilio.com/hc/en-us/articles/223181668-Can-Twilio-numbers-receive-SMS-from-a-short-code-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With