<!--
{
  "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/provideCredentialWithoutUserInteraction(for:)-3mo23",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Authentication Services"
    ],
    "preciseIdentifier" : "c:objc(cs)ASCredentialProviderViewController(im)provideCredentialWithoutUserInteractionForRequest:"
  },
  "title" : "provideCredentialWithoutUserInteraction(for:)"
}
-->

# provideCredentialWithoutUserInteraction(for:)

Attempts to provide the user-requested credential with no further user interaction.

```
func provideCredentialWithoutUserInteraction(for credentialRequest: any ASCredentialRequest)
```

## Parameters

`credentialRequest`

The credential request.

## Discussion

After the person selects a credential identity, the system creates a credential request. The contents of the request depend on the type of credential requested. If the person requests a password or one-time passcode (OTP), the credential request (a [`ASPasswordCredentialRequest`](/documentation/AuthenticationServices/ASPasswordCredentialRequest) or [`ASOneTimeCodeCredentialRequest`](/documentation/AuthenticationServices/ASOneTimeCodeCredentialRequest)) contains a credential identity. If the person requests a passkey, the [`ASPasskeyCredentialRequest`](/documentation/AuthenticationServices/ASPasskeyCredentialRequest) also contains information about the passkey assertion challenge.

The system calls [`provideCredentialWithoutUserInteraction(for:)`](/documentation/AuthenticationServices/ASCredentialProviderViewController/provideCredentialWithoutUserInteraction(for:)-3mo23) to enhance the user experience. If your credential provider extension can provide the credential without user interaction, call the relevant completion method on the extension context. For password credential requests, call [`completeRequest(withSelectedCredential:completionHandler:)`](/documentation/AuthenticationServices/ASCredentialProviderExtensionContext/completeRequest(withSelectedCredential:completionHandler:)). For passkey credential requests, call [`completeAssertionRequest(using:completionHandler:)`](/documentation/AuthenticationServices/ASCredentialProviderExtensionContext/completeAssertionRequest(using:completionHandler:)). For OTP requests, call [`completeOneTimeCodeRequest(using:completionHandler:)`](/documentation/AuthenticationServices/ASCredentialProviderExtensionContext/completeOneTimeCodeRequest(using:completionHandler:)).

If your extension requires user interaction to provide the credential, like when someone needs to unlock their credentials database, call [`cancelRequest(withError:)`](/documentation/AuthenticationServices/ASCredentialProviderExtensionContext/cancelRequest(withError:)). Use the error domain [`ASExtensionErrorDomain`](/documentation/AuthenticationServices/ASExtensionErrorDomain), and the code [`ASExtensionError.Code.userInteractionRequired`](/documentation/AuthenticationServices/ASExtensionError/Code/userInteractionRequired).

If an error occurs, call [`cancelRequest(withError:)`](/documentation/AuthenticationServices/ASCredentialProviderExtensionContext/cancelRequest(withError:)) using the error domain [`ASExtensionErrorDomain`](/documentation/AuthenticationServices/ASExtensionErrorDomain) and an appropriate code from [`ASExtensionError.Code`](/documentation/AuthenticationServices/ASExtensionError/Code).

As your view controller isn’t presented while the system calls this method, don’t show or use any user interface from this method.

---

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)