Readers like you help support XDA Developers. When you make a purchase using links on our site, we may earn an affiliate commission. Read More.

The latest iPhones and iPads are undoubtedly some of the best mobile devices you can buy today, offering users a wide range of handy tools. These include a built-in password manager that enables you to store your various login credentials. However, what many people don't know is that it also supports two-factor authentication (2FA) codes. To use it on iOS 17, iPadOS 17, or an older OS version, simply follow the steps below.

How to use the 2FA code generator on iOS or iPadOS

  1. Launch the Settings app on your iPhone or iPad.
  2. Scroll down and click on Passwords.
  3. Your device will prompt you to authenticate with Face/Touch ID or enter your device's password.
  4. Once you authenticate, you will see a list of the passwords you have saved in Apple Keychain.
  5. If the service you want to secure is on the list, click on it to view it.
  6. However, if it isn't on the list, click the plus (+) button in the top right corner and choose New Password.
  7. Fill in the required fields — the Website, User Name (or email address), and Password.
  8. Click Done in the top right corner, and the new service's details (website, user name/email, and password) will be displayed.
  9. Tap on Set Up Verification Code.
  10. iOS will prompt you to choose between entering a setup key and scanning a QR code.
  11. Using another device (not necessarily an iOS/iPadOS one), go to your account settings on the desired service's website/app and enable 2FA.
  12. You will be given a QR code and/or a setup key. You may use either to set up the code generator, so choose the one you prefer from the iDevice's prompt.

    If you don't have another device, you can copy the setup code from the website/app, then navigate to the Settings app to paste it in the Passwords section when prompted.

  13. Once you scan/add it, the expiring 2FA code in the Passwords section of the iDevice's Settings app will appear on the service's details page.
  14. Whenever you attempt to sign in to the service, and it asks for your 2FA code, head to Passwords section in the Settings app.
  15. Tap on the code to copy it.

Why it's important to use 2FA

For those unfamiliar, when 2-factor authentication is enabled, a website, app, or service won't let you log in to your account without providing a temporary code. So you will have to provide your login credentials (email/username and password), in addition to a code that typically refreshes every 30 seconds. This makes it more challenging for someone with just your username and password to access your account and data, and it could protect you from hacking and phishing attempts. That's why it's very important to use 2FA when offered by a service, and the built-in, free password manager on iOS and iPadOS makes it easy to do so.