Protocol

URLAuthenticationChallengeSender

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

Overview

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.

Topics

Protocol Methods

func cancel(URLAuthenticationChallenge)

Cancels a given authentication challenge.

Required.

func continueWithoutCredential(for: URLAuthenticationChallenge)

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

Required.

func use(URLCredential, for: URLAuthenticationChallenge)

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

Required.

func performDefaultHandling(for: URLAuthenticationChallenge)

Causes the system-provided default behavior to be used.

func rejectProtectionSpaceAndContinue(with: URLAuthenticationChallenge)

Rejects the currently supplied protection space.

Relationships

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.