How to Use Safari's Built-in 2FA Code Generator - MacRumors
Skip to Content

How to Use Safari's Built-in 2FA Code Generator

by

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

iPhone 13 Security
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 macOS Monterey and later versions of its Mac operating system software, Apple's Safari browser (version 15 and later) includes a built-in two-factor authenticator that can 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.

Enabling 2FA on the Account or Service

First, make sure you have the latest version of Safari (Safari 17). Once you've done that, you'll need to enable the use of a 2FA app on whichever website or service you are trying to secure. Note that if you've already enrolled an account with 2FA on a mobile app, you'll either have to unenroll from 2FA or use the current 2FA code from your mobile app.

twitter 2fa
You may need to explore the security or privacy settings of the site to enable the use of an authenticator app. On X (formerly Twitter) accounts, for example, the 2FA option is found 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. Note that you'll need to ensure that Safari's AutoFill feature is enabled (Safari ➝ Settings ➝ AutoFill) and the website's login credentials are saved in Safari for the 2FA code generator to work properly.

  1. Open Safari, then select Safari ➝ Settings... from the menu bar.
  2. Choose the Passwords tab, then either type your user password or use Touch ID to authenticate.
  3. Find and open the entry for the site you want to add 2FA to, then click Set Up next to "Verification Code," under Account Options.
  4. If the site offers a setup key, enter it in the Setup Key field. If it offers a QR code, Control-click it and choose "Set Up Verification Code". (Alternatively, you can download the QR code image and choose it using the option.)

safari verification codes

Using Safari's Generated 2FA Code

  1. Open Safari and navigate to the website that requires two-factor authentication (2FA).
  2. Enter your username and password for the website as usual.
  3. When the site asks for a 2FA code, look for Safari's built-in suggestion that appears above the input field.
  4. Click on the 2FA code suggestion. Safari will automatically generate and fill in a 2FA code.
  5. Complete the login process by verifying the 2FA code, and you're done.

In future, when you come to log in to the site or service and you're prompted for a verification code, Safari will automatically display the latest code as an AutoFill option – all you need to do is click the code to enter it into the input field, and away you go.

Popular Stories

safari iphone duo webkit

Apple Wants to Fix Safari's Cramped Layout on iPhone Duo

Saturday October 24, 2026 9:58 pm PDT by
Apple is considering changes to Safari on the iPhone Duo that would give websites access to more of the outer display, although the company has yet to settle on an approach. The challenge is allowing pages to occupy the area beneath Safari's side-mounted controls without making parts of a website inaccessible. In an Friday, October 23 WebKit post, Apple's Jen Simmons explained that an...
Switch to Safari

Apple Addresses Web Security Threat, Working on macOS Update With Additional Fix

Sunday October 25, 2026 4:07 pm PDT by
Earlier this month, a security researcher discovered that private cryptographic keys associated with eight of Indian company eMudhra's intermediate certificate authority (CA) certificates were weak. The compromised keys could have allowed attackers to impersonate legitimate websites, potentially putting users' sensitive information at risk. However, there is currently no evidence that the keys...
apple pro tell logo

Apple Launches Two Products Today

Friday November 13, 2026 2:37 am PST by
Apple is releasing two new products today, Friday, November 13: the all-new Apple HomeView and the fourth-generation Apple TV 4K, both of which have been available to pre-order since mid-October. Apple HomeView: Apple's new smart home display, powered by Apple Intelligence with Siri AI, for entertainment and managing the home. Available in tabletop and wall-mounted models, it can recognize up...
Latest Stories
Apple Black Friday Starts Early: Save on Apple Watch, MacBook Air, and More
Apple Black Friday Starts Early: Save on Apple Watch, MacBook Air, and More
20 hours ago
Top Stories: Apple's New Software Approach, iPhone Duo-Optimized Apps, and More
Top Stories: Apple's New Software Approach, iPhone Duo-Optimized Apps, and More
22 hours ago
HomeView Tidbits: Mirror, Sleep Timer, and Other Details
HomeView Tidbits: Mirror, Sleep Timer, and Other Details
2 days ago
Siri AI Still Not Enabled on HomePod Mini 2 With Latest Software Update
Siri AI Still Not Enabled on HomePod Mini 2 With Latest Software Update
2 days ago
Apple Releases tvOS 27.2.1 With Siri AI for Older Apple TVs
Apple Releases tvOS 27.2.1 With Siri AI for Older Apple TVs
2 days ago
Microsoft 365 Outage Resolving After Nearly 24 Hours
Microsoft 365 Outage Resolving After Nearly 24 Hours
2 days ago
iPhone Duo Survives 450,000 Folds, but Hinge is Weakening
iPhone Duo Survives 450,000 Folds, but Hinge is Weakening
2 days ago
Apple TV 4K Launch Day Deal Arrives at Amazon
Apple TV 4K Launch Day Deal Arrives at Amazon
2 days ago
The MacRumors Show: HomeView and Apple TV 4K First Impressions
The MacRumors Show: HomeView and Apple TV 4K First Impressions
2 days ago
YouTube App Not Working on Your New Apple TV? Here's the Fix
YouTube App Not Working on Your New Apple TV? Here's the Fix
2 days ago
Apple Meets Thai Officials Over iPhone Spyware Warnings
Apple Meets Thai Officials Over iPhone Spyware Warnings
2 days ago
Apple Shares HomeView 27.2 Release Notes With List of Features
Apple Shares HomeView 27.2 Release Notes With List of Features
2 days ago
HomeView in Québec: Apple Says Canadian French Support to Arrive in Software Update
HomeView in Québec: Apple Says Canadian French Support to Arrive in Software Update
2 days ago
Apple Watch Ultra 3 Gets Big $250 Discounts Ahead of Black Friday
Apple Watch Ultra 3 Gets Big $250 Discounts Ahead of Black Friday
2 days ago
Apple Says HomeView Sets New Record in Design-Focused Interview
Apple Says HomeView Sets New Record in Design-Focused Interview
2 days ago
Best Apple Deals of the Week: AirTag 2 Hits Record Low Price, Plus Early Black Friday Sales
Best Apple Deals of the Week: AirTag 2 Hits Record Low Price, Plus Early Black Friday Sales
2 days ago
iPhone 18 and 18e Coming in Spring 2027 With A20 Chip
iPhone 18 and 18e Coming in Spring 2027 With A20 Chip
2 days ago
King Charles to Join Elton John's Apple Music Radio Show
King Charles to Join Elton John's Apple Music Radio Show
2 days ago
Select 'Apple Home Collection' Accessories Now Available to Order
Select 'Apple Home Collection' Accessories Now Available to Order
2 days ago
Major Microsoft 365 Outage Continues
Major Microsoft 365 Outage Continues
2 days ago
Apple Launches Two Products Today
Apple Launches Two Products Today
2 days ago
Hands-On With the New Apple TV 4K and Siri AI
Hands-On With the New Apple TV 4K and Siri AI
2 days ago
Siri AI Coming to Older Apple TV 4K Models in tvOS 27.2.1
Siri AI Coming to Older Apple TV 4K Models in tvOS 27.2.1
3 days ago
HomeView Launch Kicks Off as First Orders Reach Customers
HomeView Launch Kicks Off as First Orders Reach Customers
3 days ago
Apple Continues to Move Up iPhone Duo Delivery Dates
Apple Continues to Move Up iPhone Duo Delivery Dates
3 days ago
Apple Explains How HomeView Keeps Camera Data Private
Apple Explains How HomeView Keeps Camera Data Private
3 days ago
Apple Releases Updated HomeView Software 27.2 Before Launch
Apple Releases Updated HomeView Software 27.2 Before Launch
3 days ago
Apple Adds Samsung Foldables to Trade-In Program
Apple Adds Samsung Foldables to Trade-In Program
3 days ago
Apple Sports App Now Features UFC
Apple Sports App Now Features UFC
3 days ago
Trump Says Tim Cook Should Be Nvidia CEO as Jensen Huang Resigns
Trump Says Tim Cook Should Be Nvidia CEO as Jensen Huang Resigns
3 days ago