ASCredentialProviderViewController
A view controller that a credential manager app uses to extend AutoFill.
Declaration
class ASCredentialProviderViewControllerOverview
To integrate a password, passkey, or one-time passcode manager app with AutoFill:
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.
Override the view controller’s prepareCredentialList(for:) method to prepare a view with a list of credentials that the person can choose from after opening your extension from the AutoFill suggestions list.
Optionally add ASPasswordCredentialIdentity and ASPasskeyCredentialIdentity instances to the shared ASCredentialIdentityStore to make identities available directly in the AutoFill suggestions list. Then override the provideCredentialWithoutUserInteraction(for:) method to provide the associated credentials when the person taps a suggestion.
Optionally, override the prepareInterfaceForExtensionConfiguration() method to specify a configuration interface that you can show when people first enable your credentials manager in Settings.
Receiving credential updates
Apps and websites that allow sign-ins can signal updates to the operating system with the ASCredentialUpdater class. The various “report” methods of ASCredentialUpdater work like the “signal” methods of PublicKeyCredential when using WebAuthn on the web. For example, a website or app can notify credential manager apps that it updated a user name or email for a given account, allowing the manager to stay consistent with the website.
Your credential manager manager receives these updates in the “report” methods of ASCredentialProviderViewController. Use these calls to update your manager’s stored credential data or behavior. For example, a call to reportUnusedPasswordCredential(forDomain:userName:) can indicate that someone using a passkey will no longer use a password to sign in to a given domain, or that they deleted their account. In this case, the manager should stop showing the user name and password for that domain.
Topics
Getting the extension context
Configuring the credential provider extension
Selecting a credential
prepareCredentialList(for:)prepareCredentialList(for:requestParameters:)prepareOneTimeCodeCredentialList(for:)prepareInterface(forPasskeyRegistration:)prepareInterfaceToProvideCredential(for:)provideCredentialWithoutUserInteraction(for:)performWithoutUserInteractionIfPossible(passkeyRegistration:)ASCredentialServiceIdentifierASCredentialRequestASPasswordCredentialRequestASOneTimeCodeCredentialRequestASAuthorizationPublicKeyCredentialRegistrationRequestASPasskeyCredentialRequestASPasskeyCredentialRequestParameters
Providing text to AutoFill
Recognizing errors
Accessing settings
Receiving credential updates
reportAllAcceptedPublicKeyCredentials(forRelyingParty:userHandle:acceptedCredentialIDs:)reportPublicKeyCredentialUpdate(forRelyingParty:userHandle:newName:)reportUnknownPublicKeyCredential(forRelyingParty:credentialID:)reportUnusedPasswordCredential(forDomain:userName:)