<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/ASCredentialImportManager",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Authentication Services"
    ],
    "preciseIdentifier" : "s:22AuthenticationServices25ASCredentialImportManagerC"
  },
  "title" : "ASCredentialImportManager"
}
-->

# ASCredentialImportManager

A class to manage importing credentials.

```
class ASCredentialImportManager
```

## Overview

`ASCredentialImportManager` allows your app to exchange authentication credentials such as passwords and passkeys with other apps. Participating apps, such as password managers, export credentials to your app by using the [`ASCredentialExportManager`](/documentation/AuthenticationServices/ASCredentialExportManager) class.

### Configuring your app

To participate in credential exchange, edit your credential provider extension’s information property list and add the following key with a Boolean value of `YES`:

`NSExtension > NSExtensionAttributes > ASCredentialProviderExtensionCapabilities > SupportsCredentialExchange`

Also, declare the versions of the credential data format your app supports using the following key:

`NSExtension > NSExtensionAttributes > ASCredentialProviderExtensionCapabilities > SupportedCredentialExchangeVersions`

The value is an array of strings containing every version your app supports.
Currently, the only available version is `1.0`.

### Importing credentials

Credential export begins when another app calls [`exportCredentials(_:)`](/documentation/AuthenticationServices/ASCredentialExportManager/exportCredentials(_:)), which brings up a system UI to choose an app to export to.
When the person using the export app chooses your app to receive the credentials, the system launches your app and sends an  <doc://com.apple.documentation/documentation/Foundation/NSUserActivity> whose <doc://com.apple.documentation/documentation/Foundation/NSUserActivity/activityType> is `ASCredentialExchangeActivity`.
To support this process, add the <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/NSUserActivityTypes> array to your app’s information property list and add the item `ASCredentialExchangeActivityType` to the array.

Your app needs to prepare for the system launching the app from this activity by fetching the `ASCredentialImportToken` from the activity’s  <doc://com.apple.documentation/documentation/Foundation/NSUserActivity/userInfo> dictionary.
The value of this key is a <doc://com.apple.documentation/documentation/Foundation/UUID> token; create an instance of [`ASCredentialImportManager`](/documentation/AuthenticationServices/ASCredentialImportManager) and pass the token to [`importCredentials(token:)`](/documentation/AuthenticationServices/ASCredentialImportManager/importCredentials(token:)) to begin the import process.

The following example shows how a SwiftUI app handles launching from the user activity and beginning the credential import process.

```swift
 struct CredentialImportManagerExample: View {
     @Environment(\.credentialImportManager) private var credentialImportManager

     var body: some View {
         content // Defined elsewhere.
             .onContinueUserActivity(ASCredentialExchangeActivityType) { activity in
                 Task {
                     do {
                         guard let token = activity.userInfo?[ASCredentialImportToken] as? UUID else { return }
                         let credentialData = try await credentialImportManager.importCredentials(token: token)
                         // Do something with the data.
                     } catch {
                         // Handle the import error.
                     }
                 }
             }
     }
 }
```

For a corresponding export code example, see [`ASCredentialExportManager`](/documentation/AuthenticationServices/ASCredentialExportManager).

## Topics

### Creating an import manager

[`init()`](/documentation/AuthenticationServices/ASCredentialImportManager/init())

Creates an import manager instance.

### Importing credentials

[`importCredentials(token:)`](/documentation/AuthenticationServices/ASCredentialImportManager/importCredentials(token:))

Begins the credential import process.

[`ASExportedCredentialData`](/documentation/AuthenticationServices/ASExportedCredentialData)

A container for credential data that your app provides to an exporter or receives from an importer.



---

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)