<!--
{
  "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/URLAuthenticationChallenge/sender",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSURLAuthenticationChallenge(py)sender"
  },
  "title" : "sender"
}
-->

# sender

The sender of the challenge.

```
var sender: (any URLAuthenticationChallengeSender)? { get }
```

## Discussion

If you are using the [`URLSession`](/documentation/Foundation/URLSession) API, this value is purely informational, because you *must* respond to authentication challenges in your [`URLSessionDelegate`](/documentation/Foundation/URLSessionDelegate) or [`URLSessionTaskDelegate`](/documentation/Foundation/URLSessionTaskDelegate) implementations, by passing [`URLSession.AuthChallengeDisposition`](/documentation/Foundation/URLSession/AuthChallengeDisposition) constants to the provided completion handler blocks.

However, if you are using the legacy `NSURLConnection` or `NSURLDownload` API, you use this object directly in your authentication handler delegate method. With these APIs, after you finish processing the authentication challenge, you respond by calling methods defined in the [`URLAuthenticationChallengeSender`](/documentation/Foundation/URLAuthenticationChallengeSender) protocol on this sender.

> Warning:
> Do not call methods directly on this object if you are using the ``doc://com.apple.foundation/documentation/Foundation/URLSession`` API.

---

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)