Contents

download(_:canAuthenticateAgainstProtectionSpace:)

Sent to determine whether the delegate is able to respond to a protection space’s form of authentication.

Declaration

optional func download(_ connection: NSURLDownload, canAuthenticateAgainstProtectionSpace protectionSpace: URLProtectionSpace) -> Bool

Parameters

  • connection:

    The download sending the message.

  • protectionSpace:

    The protection space that generates an authentication challenge.

Discussion

This method is called before download(_:didReceive:), allowing the delegate to inspect a protection space before attempting to authenticate against it. By returning true, the delegate indicates that it can handle the form of authentication, which it does in the subsequent call to download(_:didReceive:). Not implementing this method is the same as returning false, in which case default authentication handling is used.

See Also

Download Authentication