<!--
{
  "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/importCredentials(token:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Authentication Services"
    ],
    "preciseIdentifier" : "s:22AuthenticationServices25ASCredentialImportManagerC17importCredentials5tokenAA24ASExportedCredentialDataV10Foundation4UUIDV_tYaKF"
  },
  "title" : "importCredentials(token:)"
}
-->

# importCredentials(token:)

Begins the credential import process.

```
func importCredentials(token: UUID) async throws -> ASExportedCredentialData
```

## Parameters

`token`

The UUID token that the system provided in the <doc://com.apple.documentation/documentation/Foundation/NSUserActivity> when launching the app.

## Return Value

The credential data exported from the source app.

## Discussion

When a person chooses your app to receive credentials exported from another app, the system launches your app using an <doc://com.apple.documentation/documentation/Foundation/NSUserActivity> of type `ASCredentialExchangeActivityType`.
Handle this in your app delegate for AppKit/UIKit or the <doc://com.apple.documentation/documentation/SwiftUI/View/onContinueUserActivity(_:perform:)> modifier for SwiftUI.
The `NSUserActivity` you receive contains a single <doc://com.apple.documentation/documentation/Foundation/UUID> object in its `userInfo` field with the key `ASCredentialImportToken`; pass this UUID as the `token` parameter to this method.

This method throws an error if the import can’t proceed, which happens if the token doesn’t match what the system expects, indicating an app other than the one the export was meant for.

---

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)