<!--
{
  "availability" : [
    "iOS: 9.2.0 - 15.0.0",
    "iPadOS: 9.2.0 - 15.0.0",
    "macCatalyst: 13.1.0 - 15.0.0",
    "macOS: 10.11.0 - 12.0.0",
    "tvOS: 9.1.0 - 15.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 3.0.0 - 8.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKFetchWebAuthTokenOperation/fetchWebAuthTokenCompletionBlock",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKFetchWebAuthTokenOperation(py)fetchWebAuthTokenCompletionBlock"
  },
  "title" : "fetchWebAuthTokenCompletionBlock"
}
-->

# fetchWebAuthTokenCompletionBlock

The block to execute when the operation finishes.

```
var fetchWebAuthTokenCompletionBlock: ((String?, (any Error)?) -> Void)? { get set }
```

## Discussion

The closure returns no value and takes the following parameters:

- If the operation is successful, the web authentication token; otherwise, `nil`.
- An error that contains information about a problem, or `nil` if the system successfully fetches the token.

The operation executes this closure only once. You must provide a closure capable of executing on a background thread, so any tasks that require access to the main thread must dispatch accordingly.

---

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)