A view controller that a password manager app uses to extend Password AutoFill.


class ASCredentialProviderViewController : UIViewController


To integrate a password manager app with AutoFill:

  1. Add a Credential Provider Extension target to your project that subclasses ASCredentialProviderViewController. Add the AutoFill Credential Provider Entitlement to both the extension and its containing app.

  2. Override the view controller’s prepareCredentialList(for:) method to prepare a view with a list of credentials from which the user can pick after opening your extension from the QuickType bar.

  3. Optionally add ASPasswordCredentialIdentity instances to the shared ASCredentialIdentityStore to make identities available directly in the QuickType bar. Then override the provideCredentialWithoutUserInteraction(for:) method to provide the associated credentials when the user taps an item in the bar.

  4. Optionally, override the prepareInterfaceForExtensionConfiguration() method to specify a configuration interface that you can show when users first enable your password manager in Settings.


Getting the Extension Context

var extensionContext: ASCredentialProviderExtensionContext

The context your credential provider extension uses to provide information to the system.

class ASCredentialProviderExtensionContext

A mechanism that credential provider extensions use to communicate with the system.

Configuring the Credential Provider Extension

func prepareInterfaceForExtensionConfiguration()

Prepares the interface to enable the user to configure the extension.

class ASCredentialIdentityStore

A container that your extension fills to provide credentials through the QuickType bar.

Selecting a Credential

func prepareCredentialList(for: [ASCredentialServiceIdentifier])

Prepares the interface to display a list of credentials from which the user can select.

class ASCredentialServiceIdentifier

An identifier representing a particular service for which the user needs a credential, like a web site.

Integrating Your Extension with the QuickType Bar

func provideCredentialWithoutUserInteraction(for: ASPasswordCredentialIdentity)

Attempts to provide the user-requested credential with no further user interaction.

func prepareInterfaceToProvideCredential(for: ASPasswordCredentialIdentity)

Prepares the interface for a user interaction, like a database login, that enables it to access and return the credential for the given identity.

class ASPasswordCredentialIdentity

A description that uniquely identifies a particular credential.

Recognizing Errors

struct ASExtensionError

A credential provider extension error.

See Also

AutoFill Credential Provider Support

AutoFill Credential Provider Entitlement

A Boolean value that indicates whether the app may, with user permission, provide user names and passwords for AutoFill in Safari and other apps.