Want to use two-factor authentication to protect your accounts online—without codes through text message, calls or even a separate “authenticator” app? Find out here how to set up and use Safari as a two-factor authenticator app on a Mac.
First, Look at a Lava Lamp’s Perturbations
Look at a lava lamp for a short while. Look for a long while.
No matter how intently you stare, you will never quite know what pattern und perturbation comes next.
This unpredictability makes a concert of lava lamps a swell source for randomness. Randomness, of course, is important for safe encryption.
So, a camera stares at some one hundred lava lamps in motion at Cloudflare’s offices to help keep Internet traffic secure.
You can do something, too, for security with two-factor authentication—and you need not even stare at your phone to do it:
How to Set Up Safari for Mac as a Two-Factor Authenticator App
Time needed: 3 minutes
To add a new web site account for generating two-factor authentication codes right in Safari for macOS on a Mac:
- Click on the QR code for setting up a two-factor authenticator (2FA) app with the right mouse button in Safari.
No QR code: If you have no QR graphic but an alphanumeric code, see below.
- Select Set Up Verification Code from the connects menu that has appeared.
- Unlock passwords with your iCloud or macOS authentication
- Highlight the account for wich you want to add the 2FA authenticator code.
- Click Add Verification Code.
On an iPhone? How to Use Safari as an Authenticator App on iPhone
Set up Safari as a 2FA Authenticator App without a QR Code
To set up 2-factor authentication in Safari using an alphanumeric code:
- Open System Settings (or System Preferences) on the Mac.
Here’s how: Choose (Apple logo) in the menu bar, for instance, and select System Settings… from the menu that appears. - Go to the Passwords category.
Alternative: You can also open the Passwords tab in Safari settings; they access the same set of passwords and 2FA authentication data. - Log in to the Mac account with your password, fingerprint, or other means of authentication.
- Highlight the web site account for which you want to add two-factor authentication data.
New account: You can also click + to add a new account, of course. - Click Edit….
- Now select Enter Setup Key… under Verification Code:.
- Type or paste the code for setting up two-factor authentication from the web site or app.
- Click OK.
Enter a Verification Code using Safari as a Two-Factor Authenticator App
To authenticate on a website using Safari’s built-in 2FA authenticator app:
- Click in the field to enter the authentication code.
- Select the desired account from auto-complete data.
Authorize: Authenticate with your Mac using password, fingerprint or another factor if prompted. - Press Enter if needed.
Done automatically: Usually, Safari will submit the authentication code automatically without you pressing Enter.
How to Use Safari as a Two-Factor Authenticator App for Mac: FAQ
Can I copy the verification code for use in a different browser?
Yes.
To use the code generated by the Safari two-factor authentication app in another browser:
- Open Passwords in System Settings (see above).
- Search for an open the desired account.
- Click on the code under Verification Code.
- Select Copy Verification Code from the context menu that has appeared.
Can I reset or renew the authentication info for an account?
Each account always can only have one key shared between the site and Safari for authenticating access.
To add a new key, first delete the old one:
- Open Passwords in System Settings. (See above.)
- Highlight the account for which you want to add new 2FA information.
Search: Click in the Search field, of course, and type the domain or username. - Click Edit….
- Now click Delete Verification Code.
- Click Delete Verification Code again.
- Now click Save.
How does code generation for 2FA work?
When you set up code generation in Safari for two-factor authentication, you enter a secret value from the web site into Safari.
Using
- that secret value (known now to both the site and your Safari, but nobody else),
- a value derived from the current time (also shared) and
- a common algorithm,
both the website and Safari compute a code, which they then compare.
(How to use Safari as a two-factor authenticator app for Mac tested with Safari 15–17; first published October 2021, last updated September 2024)