The sender of the challenge.
SDKs
- iOS 2.0+
- macOS 10.2+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
var sender: URLAuthentication Challenge Sender? { get }
Discussion
If you are using the URLSession
API, this value is purely informational, because you must respond to authentication challenges in your URLSession
or URLSession
implementations, by passing URLSession
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 URLAuthentication
protocol on this sender.
Warning
Do not call methods directly on this object if you are using the URLSession
API.