performWithoutUserInteractionIfPossible(passkeyRegistration:)
Perform a conditional passkey registration, if possible.
Declaration
func performWithoutUserInteractionIfPossible(passkeyRegistration registrationRequest: ASPasskeyCredentialRequest)Discussion
This method will be called for handling conditional passkey registration requests. A conditional passkey registration request allows your extension to opportunistically register passkeys in the background, if and only if you believe the user is in a good state to do so. Your extension decides can decide what conditions make sense for whether to fulfill or reject this request. For example, an extension may decide to register a passkey only if all of the following conditions are met:
The user’s vault is currently unlocked.
The user name for the registration request matches that for an existing saved password.
The matching saved password was filled recently.
The user does not already have a passkey for this account.
Fulfilling this request should not remove a user’s saved password for this account, but it may mean that the passkey will be preferred over the password in future AutoFill invocations, if both are supported.
Your extension should complete this request by calling -[ASCredentialProviderExtensionContext completeRegistrationRequestWithSelectedPasskeyCredential:completionHandler:] or-[ASCredentialProviderExtensionContext cancelRequestWithError:], like for standard registration requests. However, this request is not allowed to show UI and ASExtensionErrorCodeUserInteractionRequired will be treated like any other error. The intent of this API is to provide a method of performing a background registration only where easy and convenient, so no blocking UI or error should ever be shown.
To indicate support for this feature, add SupportsConditionalPasskeyRegistration under the ASCredentialProviderExtensionCapabilities dictionary.
Info.plist
├─ NSExtension
├─ NSExtensionAttributes
├─ ASCredentialProviderExtensionCapabilities
├─ SupportsConditionalPasskeyRegistration => trueSee Also
Selecting a credential
prepareCredentialList(for:)prepareCredentialList(for:requestParameters:)prepareOneTimeCodeCredentialList(for:)prepareInterface(forPasskeyRegistration:)prepareInterfaceToProvideCredential(for:)provideCredentialWithoutUserInteraction(for:)ASCredentialServiceIdentifierASCredentialRequestASPasswordCredentialRequestASOneTimeCodeCredentialRequestASAuthorizationPublicKeyCredentialRegistrationRequestASPasskeyCredentialRequestASPasskeyCredentialRequestParameters