Kingfisher Documentation

Protocol Authentication​Challenge​Responsable

public protocol AuthenticationChallengeResponsable: AnyObject  

Protocol indicates that an authentication challenge could be handled.

%183 AuthenticationChallengeResponsable AuthenticationChallengeResponsable AnyObject AnyObject AuthenticationChallengeResponsable->AnyObject

Conforms To

AnyObject

Default Implementations

downloader(_:​did​Receive:​completion​Handler:​)

public func downloader(
        _ downloader: ImageDownloader,
        didReceive challenge: URLAuthenticationChallenge,
        completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) 

downloader(_:​task:​did​Receive:​completion​Handler:​)

public func downloader(
        _ downloader: ImageDownloader,
        task: URLSessionTask,
        didReceive challenge: URLAuthenticationChallenge,
        completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) 

Requirements

downloader(_:​did​Receive:​completion​Handler:​)

func downloader(
        _ downloader: ImageDownloader,
        didReceive challenge: URLAuthenticationChallenge,
        completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) 

Called when a session level authentication challenge is received. This method provide a chance to handle and response to the authentication challenge before downloading could start.

Parameters

downloader Image​Downloader

The downloader which receives this challenge.

challenge URLAuthentication​Challenge

An object that contains the request for authentication.

completion​Handler @escaping (URLSession.​Auth​Challenge​Disposition, URLCredential?) -> Void

A handler that your delegate method must call.

downloader(_:​task:​did​Receive:​completion​Handler:​)

func downloader(
        _ downloader: ImageDownloader,
        task: URLSessionTask,
        didReceive challenge: URLAuthenticationChallenge,
        completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) 

Called when a task level authentication challenge is received. This method provide a chance to handle and response to the authentication challenge before downloading could start.

Parameters

downloader Image​Downloader

The downloader which receives this challenge.

task URLSession​Task

The task whose request requires authentication.

challenge URLAuthentication​Challenge

An object that contains the request for authentication.

completion​Handler @escaping (URLSession.​Auth​Challenge​Disposition, URLCredential?) -> Void

A handler that your delegate method must call.