<!--
{
  "availability" : [
    "iOS: 18.1.0 -",
    "iPadOS: 18.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SecureElementCredential",
  "identifier" : "/documentation/SecureElementCredential/CredentialSession/listCredentials()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SecureElementCredential"
    ],
    "preciseIdentifier" : "s:23SecureElementCredential0C7SessionC15listCredentialsSayAC0C0VGyYaKF"
  },
  "title" : "listCredentials()"
}
-->

# listCredentials()

Retrieves a list of of credentials to which the app has access rights.

```
func listCredentials() async throws -> [CredentialSession.Credential]
```

## Return Value

An array of credentials to which the calling app has access rights. The order of credentials in this array is random.

## Discussion

When you call this method, the framework caches a snapshot of these credentials. Because credentials can change, refresh your data models whenever your app performs any kind of write operation using the [`SecureElementCredential`](/documentation/SecureElementCredential) framework. Also update whenever your app returns to the foreground.

> Note: When you call this method from an app extension that has the <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.developer.identity-document-services.document-provider.mobile-document-types> entitlement, the returned array contains only credentials configured as Government ID credentials on the [Apple Business Register](https://register.apple.com/login) (ABR) portal.

- The most common errors are:
  - [`CredentialSession.ErrorCode.sessionInvalidated`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/sessionInvalidated): The credential session has been invalidated.
  - [`CredentialSession.ErrorCode.invalidSessionState`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/invalidSessionState): The session isn’t in the [`CredentialSession.State.management`](/documentation/SecureElementCredential/CredentialSession/State-swift.enum/management) state.

---

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)