<!--
{
  "availability" : [
    "macOS: 10.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSURLDownloadDelegate/downloadShouldUseCredentialStorage(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSURLDownloadDelegate(im)downloadShouldUseCredentialStorage:"
  },
  "title" : "downloadShouldUseCredentialStorage(_:)"
}
-->

# downloadShouldUseCredentialStorage(_:)

Sent to determine whether the URL loader should consult the credential storage to authenticate the download.

```
optional func downloadShouldUseCredentialStorage(_ download: NSURLDownload) -> Bool
```

## Parameters

`download`

The connection sending the message.

## Discussion

This method is called before any attempt to authenticate is made.  By returning <doc://com.apple.documentation/documentation/Swift/false>, the delegate tells the download not to consult the credential storage and makes itself responsible for providing credentials for any authentication challenges.  Not implementing this method is the same as returing <doc://com.apple.documentation/documentation/Swift/true>. The delegate is free to consult the credential storage itself when it receives a [`download(_:didReceive:)`](/documentation/Foundation/NSURLDownloadDelegate/download(_:didReceive:)-1pc0v) message.

---

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)