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


The methods in the protocol are generally sent by a delegate in response to receiving a connection:didReceiveAuthenticationChallenge: or download:didReceiveAuthenticationChallenge:. The different methods provide different ways of responding to authentication challenges.


Protocol Methods

func cancel(URLAuthenticationChallenge)

Cancels a given authentication challenge.


func continueWithoutCredential(for: URLAuthenticationChallenge)

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


func use(URLCredential, for: URLAuthenticationChallenge)

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


func performDefaultHandling(for: URLAuthenticationChallenge)

Causes the system-provided default behavior to be used.

func rejectProtectionSpaceAndContinue(with: URLAuthenticationChallenge)

Rejects the currently supplied protection space.


Inherits From

See Also

Getting authentication challenge properties

var error: Error?

The error object representing the last authentication failure.

var failureResponse: URLResponse?

The URL response object representing the last authentication failure.

var previousFailureCount: Int

The receiver’s count of failed authentication attempts.

var proposedCredential: URLCredential?

The proposed credential for this challenge.

var protectionSpace: URLProtectionSpace

The receiver’s protection space.