<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.2.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLAuthenticationChallengeSender",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSURLAuthenticationChallengeSender"
  },
  "title" : "URLAuthenticationChallengeSender"
}
-->

# URLAuthenticationChallengeSender

The `URLAuthenticationChallengeSender` protocol represents the interface that the sender of an authentication challenge must implement.

```
protocol URLAuthenticationChallengeSender : NSObjectProtocol, Sendable
```

## Overview

The methods in the protocol are generally sent by a delegate in response to receiving a [`connection(_:didReceive:)`](/documentation/Foundation/NSURLConnectionDelegate/connection(_:didReceive:)): or [`download(_:didReceive:)`](/documentation/Foundation/NSURLDownloadDelegate/download(_:didReceive:)-1pc0v):. The different methods provide different ways of responding to authentication challenges.

> Important:
> This protocol is *only* for use with the legacy ``doc://com.apple.foundation/documentation/Foundation/NSURLConnection`` and ``doc://com.apple.foundation/documentation/Foundation/NSURLDownload`` classes. It should not be used with ``doc://com.apple.foundation/documentation/Foundation/URLSession``-based code, for which you respond to authentication challenges by passing ``doc://com.apple.foundation/documentation/Foundation/URLSession/AuthChallengeDisposition`` constants to the provided completion handler blocks.

## Topics

### Protocol Methods

[`cancel(_:)`](/documentation/Foundation/URLAuthenticationChallengeSender/cancel(_:))

Cancels a given authentication challenge.

[`continueWithoutCredential(for:)`](/documentation/Foundation/URLAuthenticationChallengeSender/continueWithoutCredential(for:))

Attempt to continue downloading a request without providing a credential for a given challenge.

[`use(_:for:)`](/documentation/Foundation/URLAuthenticationChallengeSender/use(_:for:))

Attempt to use a given credential for a given authentication challenge.

[`performDefaultHandling(for:)`](/documentation/Foundation/URLAuthenticationChallengeSender/performDefaultHandling(for:))

Causes the system-provided default behavior to be used.

[`rejectProtectionSpaceAndContinue(with:)`](/documentation/Foundation/URLAuthenticationChallengeSender/rejectProtectionSpaceAndContinue(with:))

Rejects the currently supplied protection space.



---

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)