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

Switch to Safari

Apple Explains Why Chrome Users Should 'Switch to Safari'

Tuesday October 13, 2026 5:29 am PDT by
Apple has launched a new "Switch to Safari" marketing campaign that encourages Chrome users to switch to Safari as their web browser of choice on the Mac. "Safari is a more powerful and private browser than Chrome," says Apple. Apple has a new "Switch to Safari" page on its website that outlines more than 10 reasons that Chrome users should switch to Safari, including faster performance...
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...
Latest Stories
Here's What Apple Fixed in iOS 27.2.1 and macOS 27.2.1
Here's What Apple Fixed in iOS 27.2.1 and macOS 27.2.1
11 hours ago
Webex Gets iPhone Duo Support
Webex Gets iPhone Duo Support
12 hours ago
Meta's Muse AI Agent Comes to Apple Watch
Meta's Muse AI Agent Comes to Apple Watch
12 hours ago
Anker Launches Eufy Security Cam With Auto-Tracking Light
Anker Launches Eufy Security Cam With Auto-Tracking Light
13 hours ago
macOS 27.2.1 Fixes eMudhra Certificate Flaw in Command-Line Tools
macOS 27.2.1 Fixes eMudhra Certificate Flaw in Command-Line Tools
14 hours ago
Anthropic Launches Claude Fable 5.2 and Mythos 5.2
Anthropic Launches Claude Fable 5.2 and Mythos 5.2
15 hours ago
Apple Releases macOS Golden Gate 27.2.1
Apple Releases macOS Golden Gate 27.2.1
16 hours ago
Apple Releases iOS 27.2.1 With Bug Fixes
Apple Releases iOS 27.2.1 With Bug Fixes
16 hours ago
Apple Releases watchOS 27.2.1 and visionOS 27.2.1 With Security Fixes
Apple Releases watchOS 27.2.1 and visionOS 27.2.1 With Security Fixes
16 hours ago
Apple Watch Ultra 4 Gets $99 Amazon Discounts, Starting at $699.99
Apple Watch Ultra 4 Gets $99 Amazon Discounts, Starting at $699.99
16 hours ago
Apple Pay Ad Features Martial Arts Convenience Store Food Fight
Apple Pay Ad Features Martial Arts Convenience Store Food Fight
16 hours ago
Apple Continues to Say Some AI Features Will Have Fees for Extra Usage
Apple Continues to Say Some AI Features Will Have Fees for Extra Usage
17 hours ago
Apple Announces Türkiye Expansion Plans as Tim Cook Visits
Apple Announces Türkiye Expansion Plans as Tim Cook Visits
18 hours ago
Singapore Saved Apple $2.7 Billion in Taxes This Year
Singapore Saved Apple $2.7 Billion in Taxes This Year
18 hours ago
Apple Music's 2026 Artist of the Year is Olivia Dean
Apple Music's 2026 Artist of the Year is Olivia Dean
18 hours ago
This Could Be Your Last Chance to Pre-Order the HomeView at a Discount
This Could Be Your Last Chance to Pre-Order the HomeView at a Discount
19 hours ago
Some HomePod Mini 2 Buyers Returning Units Over Mac Speaker Issues
Some HomePod Mini 2 Buyers Returning Units Over Mac Speaker Issues
19 hours ago
MacBook Pro With PROLED XDR Display: Details You Might Have Missed
MacBook Pro With PROLED XDR Display: Details You Might Have Missed
19 hours ago
Satechi Offers MacRumors Readers 30% Off Select Accessories in Early Black Friday Sale
Satechi Offers MacRumors Readers 30% Off Select Accessories in Early Black Friday Sale
19 hours ago
Leaker Envisions a Shorter iPhone With a New iOS Layout
Leaker Envisions a Shorter iPhone With a New iOS Layout
20 hours ago
Apple to Give You More Control Over When Your Mac Passwords Lock
Apple to Give You More Control Over When Your Mac Passwords Lock
21 hours ago
Siri Is Getting a Better Memory
Siri Is Getting a Better Memory
21 hours ago
iPhone 18e Could Feature Bigger Display and Battery
iPhone 18e Could Feature Bigger Display and Battery
22 hours ago
Apple's Siri Boss May Leave - Here's Who Could Take Over
Apple's Siri Boss May Leave - Here's Who Could Take Over
22 hours ago
Apple Launching Two More New Products This Friday
Apple Launching Two More New Products This Friday
22 hours ago
Apple Store Subscription Sign-Up Controversy Exposed
Apple Store Subscription Sign-Up Controversy Exposed
1 day ago
Siri AI Rumored to Become 'More Like an Agent' as Early as Next Year
Siri AI Rumored to Become 'More Like an Agent' as Early as Next Year
2 days ago
Apple Taking New Approach to Developing iOS 28 and macOS 28
Apple Taking New Approach to Developing iOS 28 and macOS 28
2 days ago
Early Apple Black Friday Deals on Apple Watch, MacBook Air, and More
Early Apple Black Friday Deals on Apple Watch, MacBook Air, and More
3 days ago
'Backglow' Lets You Customize New MacBook Pro's Glowing Apple Logo
'Backglow' Lets You Customize New MacBook Pro's Glowing Apple Logo
3 days ago