How to Set Up and Use the Built-in 2FA Code Generator in iOS - MacRumors
Skip to Content

How to Set Up and Use the Built-in 2FA Code Generator in iOS

by

With online account hacking becoming increasingly widespread, all users should make sure they're taking every security measure available to them. If you use Apple devices, consider using Apple verification codes to protect your accounts. Keep reading to learn how it works.

iPhone Security Feature 1
One of the best ways to protect any online account is by using two-factor authentication (2FA). 2FA offers hardened security during login attempts by requesting that the user provides an extra piece of information only they would know, such as a randomly generated code from a third-party.

In iOS 15, iPadOS 15, macOS Monterey, and later versions of its operating system software, Apple includes a built-in two-factor authenticator that lets iOS devices be used to generate verification codes for additional sign-in security.

This means if a site offers 2FA, you can set up verification codes for it without downloading a third-party app. Verification codes are backed up via iCloud, and once set up, the codes will autofill when you sign into the site using any Apple device linked to your Apple ID. This makes using 2FA on iPhone and iPad much more streamlined.

Enable 2FA on the Account or Service

Here we'll explain how to set up and use verification codes on iPhone and ‌iPad‌. You'll first need to enable the use of a 2FA app on whichever website or service you are trying to secure. (It's easier to complete this initial step on a desktop computer, as it may well involve scanning a QR code displayed on the screen using your iPhone or ‌iPad‌'s camera.)

twitter 2fa
Some sites have text message 2FA enabled by default, so you'll likely need to explore the security or privacy settings to enable the use of an authenticator app instead. On Twitter accounts, for example, the option is found in the Settings and Support dropdown menu, under Settings and privacy -> security and account access -> Security.

Using Setup Keys

Once you've enabled 2FA on the account or service in question, you'll be asked to either enter a setup key on your device or scan a QR code using your device's camera. If it's a setup key you're given, go to Settings -> Passwords, select the account from the list, then tap Set Up Verification Code.... Finally, tap Enter Setup Key in the pop-up menu and enter the key.

settings

Using QR Codes

If the account you're trying to secure gives you a QR code, open your iPhone or ‌iPad‌'s camera app and point the viewfinder at your computer's monitor screen showing the QR code.

When the viewfinder locks onto the code, tap Add Verification Code in Passwords. You'll be taken to Settings -> Passwords, where you may need to manually select the correct account to add the verification code. Once you've done that, your device will automatically generate verification codes on the password screen that are valid for 30 seconds.

In future, when you come to log in to the site or service and you're prompted for a verification code, iOS will automatically display the latest code above the virtual keyboard – all you need to do is tap the code to enter it into the input field, and away you go.

Popular Stories

iphone duo screen crack

Apple Responds to iPhone Duo Display Cracking Reports

Monday October 26, 2026 10:20 am PDT by
Shortly after the iPhone Duo launched, a few users reported hinge issues that were causing cracks in the inner display. Apple has now responded to the reports in a statement to MacRumors, saying a small number of units are affected. The response to iPhone Duo from early users has been incredibly positive, and we are seeing exciting things from developers who are rapidly updating their apps...
iPad mini OLED feature 1

Apple Announces New iPad Mini With 8.5-Inch OLED Display, A20 Pro Chip, and More

Monday October 26, 2026 6:05 am PDT by
Apple today announced a new iPad mini with a larger 8.5-inch OLED display, a nano-texture display option, a thinner and lighter design, an A20 Pro chip, a new Acoustic Display audio system that eliminates speaker holes, IP67-rated water and dust resistance, a landscape front camera, Apple's N1 chip with Wi-Fi 7 and Bluetooth 6 support, and more. Altogether, Apple says this amounts to the iPad...
Apple MacBook Pro with PROLED XDR Display family lineup feature

Apple Announces OLED MacBook Pro With Touch Display

Wednesday October 28, 2026 10:11 am PDT by
Apple today announced a new high-end MacBook Pro, which is available in 14-inch and 16-inch sizes. The new device has a PROLED XDR display that supports touch gestures, and a glowing rear Apple logo. Pricing on the MacBook Pro starts at $2,899 for the 14-inch model and $3,399 for the 16-inch model. Apple says the MacBook Pro has the "world's best display in a pro laptop." The PROLED...
Latest Stories
Here's a Hands-On Look at HomePod Mini 2's New Two-Tone Colors
Here's a Hands-On Look at HomePod Mini 2's New Two-Tone Colors
29 minutes ago
Apple Lowers App Store Fees in Taiwan Starting October 31
Apple Lowers App Store Fees in Taiwan Starting October 31
1 hour ago
HomeView Pre-Order Returns to $289.99 on Amazon
HomeView Pre-Order Returns to $289.99 on Amazon
2 hours ago
Apple Avoids Showing Pinched Fingers on iPad Mini Page in South Korea
Apple Avoids Showing Pinched Fingers on iPad Mini Page in South Korea
2 hours ago
Old 'Popcorn Time' App Left Hundreds of Thousands of Macs at Risk
Old 'Popcorn Time' App Left Hundreds of Thousands of Macs at Risk
3 hours ago
You Can Turn Off the New MacBook Pro's Touchscreen Functionality
You Can Turn Off the New MacBook Pro's Touchscreen Functionality
4 hours ago
MacBook Pro Mini-LED vs. OLED Buyer's Guide: Every Difference
MacBook Pro Mini-LED vs. OLED Buyer's Guide: Every Difference
5 hours ago
Where to Pre-Order Apple's New MacBooks, iPad Mini, and iMac
Where to Pre-Order Apple's New MacBooks, iPad Mini, and iMac
6 hours ago
Apple Releasing HomePod Mini 2 Tomorrow With These New Features
Apple Releasing HomePod Mini 2 Tomorrow With These New Features
8 hours ago
How macOS Adapts Its Controls for Touch on the New MacBook Pro
How macOS Adapts Its Controls for Touch on the New MacBook Pro
8 hours ago
Just Got an iPhone Duo? Try These Features First
Just Got an iPhone Duo? Try These Features First
10 hours ago
Apple Announced Scott Forstall's Departure 14 Years Ago Today
Apple Announced Scott Forstall's Departure 14 Years Ago Today
10 hours ago
Best Buy Opens Pre-Orders for PROLED XDR MacBook Pro With $100 Bonus Gift Cards
Best Buy Opens Pre-Orders for PROLED XDR MacBook Pro With $100 Bonus Gift Cards
21 hours ago
Here's Everything Apple Announced This Week
Here's Everything Apple Announced This Week
22 hours ago
Here's a Real-World Look at the New MacBook Pro's Glowing Apple Logo
Here's a Real-World Look at the New MacBook Pro's Glowing Apple Logo
22 hours ago
How Accurate Were Rumors About Apple's OLED Touchscreen MacBook Pro?
How Accurate Were Rumors About Apple's OLED Touchscreen MacBook Pro?
22 hours ago
Apple Has 8 New Products Available for Pre-Order
Apple Has 8 New Products Available for Pre-Order
1 day ago
iPhone Duo: Turn the Hinge Into an App Launcher
iPhone Duo: Turn the Hinge Into an App Launcher
1 day ago
OLED MacBook Pro vs. Mini-LED MacBook Pro: Size and Weight Compared
OLED MacBook Pro vs. Mini-LED MacBook Pro: Size and Weight Compared
1 day ago
Best Buy Offering Up to $100 Gift Cards With iPad Mini 8 and M6 MacBook Pro Pre-Orders
Best Buy Offering Up to $100 Gift Cards With iPad Mini 8 and M6 MacBook Pro Pre-Orders
1 day ago
Adding Touch Didn't Cost the MacBook Pro Any Battery Life
Adding Touch Didn't Cost the MacBook Pro Any Battery Life
1 day ago
Apple Releases Redesigned Mac Chargers and 'World Travel Adapter Kit'
Apple Releases Redesigned Mac Chargers and 'World Travel Adapter Kit'
1 day ago
Apple Executives Explain Why the MacBook Pro Finally Has a Touch Screen
Apple Executives Explain Why the MacBook Pro Finally Has a Touch Screen
1 day ago
New MacBook Pro Features Deeper Bass and Improved Closed-Lid Audio
New MacBook Pro Features Deeper Bass and Improved Closed-Lid Audio
1 day ago
New MacBook Pro Offers Up to 16TB of Storage, Double Previous Limit
New MacBook Pro Offers Up to 16TB of Storage, Double Previous Limit
1 day ago
Apple's New Touchscreen MacBook Pro Costs Up to $14,549
Apple's New Touchscreen MacBook Pro Costs Up to $14,549
1 day ago
Apple Brings Dynamic Island to Mac for the First Time
Apple Brings Dynamic Island to Mac for the First Time
1 day ago
Mac Studio With M5 Ultra Now Available With 512GB RAM for $22,299
Mac Studio With M5 Ultra Now Available With 512GB RAM for $22,299
1 day ago
Illuminated Apple Logo Returns to MacBook Pro After 10 Years
Illuminated Apple Logo Returns to MacBook Pro After 10 Years
1 day ago
Apple Announces OLED MacBook Pro With Touch Display
Apple Announces OLED MacBook Pro With Touch Display
1 day ago