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

apple pro tell logo

Apple Launching Five New Products This Friday

Monday November 2, 2026 1:22 am PST by
Apple is releasing five new products this Friday, November 6, following pre-orders that opened last week, including its first touchscreen MacBook Pro models. The following new products will be available from Friday: iPad mini with OLED display and A20 Pro chip iMac with M6 chip 14-inch MacBook Pro with M6 chip 14-inch MacBook Pro with OLED touchscreen 16-inch MacBook Pro with OLED...
Apple Logo Gradient 16x9 1

Apple Isn't Done With 2026: Here's What's Still Coming

Monday November 2, 2026 7:27 am PST by
Apple's busiest season isn't over yet. Far from it. With two hardware launch dates still to come in November, plus software updates and new smart home accessories running into December, there's more on the way from Apple before the end of 2026, so be sure to stick around. Below, we've rounded up what's still coming, along with one date in particular that's worth watching if you're a holiday...
apple pro tell logo

Apple Launching Five New Products Tomorrow

Thursday November 5, 2026 12:59 am PST by
Apple is releasing five new products this Friday, November 6, following pre-orders that opened last week, including its first touchscreen MacBook Pro models. The following new products will be available from tomorrow: iPad mini with OLED display and A20 Pro chip iMac with M6 chip 14-inch MacBook Pro with M6 chip 14-inch MacBook Pro with OLED touchscreen 16-inch MacBook Pro with OLED...
Latest Stories
Claude Gets Personal Finance Feature With Bank Account Linking
Claude Gets Personal Finance Feature With Bank Account Linking
10 minutes ago
Apple Arcade Adds Crossy Road Rush and NBA 2K27
Apple Arcade Adds Crossy Road Rush and NBA 2K27
44 minutes ago
Apple's New HomeView Smart Home Hub: Here's How Much RAM It Has
Apple's New HomeView Smart Home Hub: Here's How Much RAM It Has
1 hour ago
iPad Mini vs. iPad Air Buyer's Guide: Now Just $50 Apart
iPad Mini vs. iPad Air Buyer's Guide: Now Just $50 Apart
2 hours ago
First iOS 27.3 and macOS Golden Gate 27.3 Public Betas Now Available
First iOS 27.3 and macOS Golden Gate 27.3 Public Betas Now Available
4 hours ago
Apple Announces a New Mac Sales Record
Apple Announces a New Mac Sales Record
5 hours ago
Paid $200 for Logic Pro? Apple Says You Won't Get This New Feature
Paid $200 for Logic Pro? Apple Says You Won't Get This New Feature
5 hours ago
Instagram's Edits Video Editor is Now Available on Mac
Instagram's Edits Video Editor is Now Available on Mac
5 hours ago
Prevent Siri and Search From Accessing Specific iPhone Apps
Prevent Siri and Search From Accessing Specific iPhone Apps
6 hours ago
Best Early Black Friday Deals on iPhone 18 Pro and iPhone Duo
Best Early Black Friday Deals on iPhone 18 Pro and iPhone Duo
7 hours ago
MacBook Pro PROLED XDR Reviews Are In: Is the Touchscreen Worth It?
MacBook Pro PROLED XDR Reviews Are In: Is the Touchscreen Worth It?
7 hours ago
Early Black Friday Accessory Deals at Amazon Include TVs, Headphones, and Charging Devices
Early Black Friday Accessory Deals at Amazon Include TVs, Headphones, and Charging Devices
8 hours ago
Apple Creator Studio App Updates Rolling Out, Starting With Logic Pro
Apple Creator Studio App Updates Rolling Out, Starting With Logic Pro
8 hours ago
Siri AI Waitlist Now Limited to Times of 'High Demand,' Says Apple
Siri AI Waitlist Now Limited to Times of 'High Demand,' Says Apple
10 hours ago
See Apple's Touchscreen MacBook Pro in Action
See Apple's Touchscreen MacBook Pro in Action
10 hours ago
MacBook Neo Shipments Expected to Double in 2027
MacBook Neo Shipments Expected to Double in 2027
11 hours ago
HomeView Code Suggests Future Support for AI Chatbot Apps, Anti-Spoofing Protection
HomeView Code Suggests Future Support for AI Chatbot Apps, Anti-Spoofing Protection
11 hours ago
Got an iPhone Duo on Launch Day? Tomorrow Could Be Your Last Chance to Return It
Got an iPhone Duo on Launch Day? Tomorrow Could Be Your Last Chance to Return It
12 hours ago
Apple Launching Five New Products Tomorrow
Apple Launching Five New Products Tomorrow
14 hours ago
Apple Releases Safari Technology Preview 256 With Bug Fixes and Performance Improvements
Apple Releases Safari Technology Preview 256 With Bug Fixes and Performance Improvements
23 hours ago
Apps Can Now Try to Stop You From Canceling Subscriptions
Apps Can Now Try to Stop You From Canceling Subscriptions
23 hours ago
'Super Mario Odyssey' Can Now Run on Apple TV Thanks to AI
'Super Mario Odyssey' Can Now Run on Apple TV Thanks to AI
1 day ago
How 'Resident Evil' Director Zach Cregger Uses His iPhone to Make Movies
How 'Resident Evil' Director Zach Cregger Uses His iPhone to Make Movies
1 day ago
HomePod Mini 2's Amount of RAM Confirmed
HomePod Mini 2's Amount of RAM Confirmed
1 day ago
Apple TV's '12 Days of Snoopy' Special Arrives November 13
Apple TV's '12 Days of Snoopy' Special Arrives November 13
1 day ago
Apple is Putting Employees on an AI Budget
Apple is Putting Employees on an AI Budget
1 day ago
Apple Releases Xcode 27.3 Beta With Three New Features
Apple Releases Xcode 27.3 Beta With Three New Features
1 day ago
Apple Will Check Public iCloud Links for Harmful Content Starting in iOS 27.3
Apple Will Check Public iCloud Links for Harmful Content Starting in iOS 27.3
1 day ago
macOS 27.3 Brings Live Activities to Macs Without Dynamic Island
macOS 27.3 Brings Live Activities to Macs Without Dynamic Island
1 day ago
Apple TV Reportedly Planning 'Silo' Spinoff
Apple TV Reportedly Planning 'Silo' Spinoff
1 day ago