Password AutoFill

Streamline your app’s login and onboarding procedures.

Overview

Password AutoFill simplifies login and account creation tasks for iOS apps and webpages. With just a few taps, your users can create and save new passwords or log in to an existing account. Users don’t even need to know their password; the system handles everything. This convenience increases the likelihood that users will complete your app’s onboarding process and start using your app more quickly. Additionally, by encouraging users to select unique, strong passwords, you increase the security of your app.

By default, Password AutoFill saves the user’s login credentials on their current iOS device. iOS can sync these credentials securely across the user’s devices using iCloud Keychain. Password AutoFill recommends credentials only for your app’s associated domain, and the user must authenticate using Face ID or Touch ID before accessing these credentials. For more information on privacy and security, see Approach to Privacy and iOS Security Guide.

Password AutoFill also provides credentials from third-party password managers that implement a credential provider extension. For more information on the credential provider extension, see the AuthenticationServices framework.

Enable Password AutoFill

Password AutoFill uses heuristics to determine when the user logs in or creates new passwords, and automatically provides the password QuickType bar. These heuristics give users some Password AutoFill support in most apps, even if those apps haven’t been updated to support AutoFill. However, to provide the best user experience and ensure your app fully supports Password AutoFill, perform the following steps:

  1. Set up your app’s associated domains. To learn how to set up your app’s associated domains, see Setting Up an App’s Associated Domains.

  2. Set the correct AutoFill type on relevant text fields. For an iOS app, see Enabling Password AutoFill on a Text Input View. For a web app, see Enabling Password AutoFill on an HTML Input Element.

Support Third-Party Web Services

Password AutoFill streamlines logging into web services at your domain; however, if you need to log into a third-party service, use ASWebAuthenticationSession instead, which supports Password AutoFill when your user has not already logged in.

Integrate a Password Management App with Password AutoFill

If you are developing a password management app, create AutoFill Credential Provider Extensions to surface credentials from your app in Password Autofill and pull your app’s password data into the Password AutoFill workflow. When your app integrates with Password AutoFill, users don’t have to copy and paste credentials. Instead, they can use password data stored in your app easily because the data will be offered to the user to fill in compatible user name and password fields. To integrate a password app with Password AutoFill, use in the AuthenticationServices framework.

Topics

First Steps

About the Password AutoFill Workflow

Learn how Password AutoFill interacts with both iOS and web apps.

Setting Up an App’s Associated Domains

Share credentials with a website related to your app using associated domains.

Modifying Text Input Views

Enabling Password AutoFill on a Text Input View

Ensure a text input view displays the correct AutoFill suggestions.

var textContentType: UITextContentType!

Indicates the semantic meaning expected by a text-entry area.

static let username: UITextContentType

Specifies the expectation of an account or login name.

static let password: UITextContentType

Specifies the expectation of a password.

static let newPassword: UITextContentType

Specifies the expectation of a new password.

Beta
static let oneTimeCode: UITextContentType

Specifies the expectation of a single-factor SMS login code.

Beta

Modifying Text Input Elements

Enabling Password AutoFill on an HTML Input Element

Ensure a web view or webpage provides the correct AutoFill suggestions.

Customizing Password Rules

Customizing Password AutoFill Rules

Modify the strong password rules for your app by adding your own restrictions.

var passwordRules: UITextInputPasswordRules?

This property is used to communicate requirements for passwords for your service to ensure iOS can generate compatible passwords for users.

Beta
class UITextInputPasswordRules

A class that represent password rules for a text input field.

Beta

See Also

Authorization and Authentication

Shared Web Credentials

Share credentials between iOS apps and their website counterparts.

Authorization Services

Access restricted areas of the operating system, and control access to particular features of your macOS app.

Authorization Plug-ins

Extend the authorization services API by creating plug-ins that can participate in authorization decisions.

Sessions

Manage login, authorization, and security sessions in macOS.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software