<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/ASCredentialProviderViewController/prepareInterface(forPasskeyRegistration:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Authentication Services"
    ],
    "preciseIdentifier" : "c:objc(cs)ASCredentialProviderViewController(im)prepareInterfaceForPasskeyRegistration:"
  },
  "title" : "prepareInterface(forPasskeyRegistration:)"
}
-->

# prepareInterface(forPasskeyRegistration:)

Prepare the view controller to show user interface for registering a new passkey.

```
func prepareInterface(forPasskeyRegistration registrationRequest: any ASCredentialRequest)
```

## Parameters

`registrationRequest`

The passkey registration request.

## Discussion

The system calls this method when the user selects your extension to create a passkey. Your app and extension must declare the key <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/NSExtension/NSExtensionAttributes/ASCredentialProviderExtensionCapabilities/ProvidesPasskeys> with value `YES` in the <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/NSExtension/NSExtensionAttributes/ASCredentialProviderExtensionCapabilities> dictionaries of their information property lists to be available for the user to select. The system presents your extension’s authentication user interface before creating the passkey.

Call the context’s [`completeRegistrationRequest(using:completionHandler:)`](/documentation/AuthenticationServices/ASCredentialProviderExtensionContext/completeRegistrationRequest(using:completionHandler:)) method with the created passkey credential. Alternatively, if an error occurs, call [`cancelRequest(withError:)`](/documentation/AuthenticationServices/ASCredentialProviderExtensionContext/cancelRequest(withError:)), using [`ASExtensionErrorDomain`](/documentation/AuthenticationServices/ASExtensionErrorDomain) as the error domain and an appropriate error code from [`ASExtensionError.Code`](/documentation/AuthenticationServices/ASExtensionError/Code).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)