---
title: "downloadShouldUseCredentialStorage(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsurldownloaddelegate/downloadshouldusecredentialstorage(_:)"
---

# downloadShouldUseCredentialStorage(_:)

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

## Declaration

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

## Parameters

- `download`: The connection sending the message.

## Discussion

Discussion This method is called before any attempt to authenticate is made.  By returning 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 true. The delegate is free to consult the credential storage itself when it receives a download(_:didReceive:) message.

## See Also

### Download Authentication

- [download(_:canAuthenticateAgainstProtectionSpace:)](foundation/nsurldownloaddelegate/download(_:canauthenticateagainstprotectionspace:).md)
- [download(_:didCancel:)](foundation/nsurldownloaddelegate/download(_:didcancel:).md)
- [download(_:didReceive:)](foundation/nsurldownloaddelegate/download(_:didreceive:)-1pc0v.md)
