URLCredentialProvider
public protocol URLCredentialProvider
A protocol for the class that will provide the URLCredential
for the
specified authentication challenge.
-
A class conforming to this protocol should implement this method and return an appropriate
URLCredential
object for the authentication challenge. The conforming class should also be registered with APIRequestType protocol for it to be actually called.See also
APIRequestType
Declaration
Swift
static func credential(forChallenge challenge: URLAuthenticationChallenge, onTask task: URLSessionTask) -> URLCredential?
Parameters
challenge
The
URLAuthenticationChallenge
received by the URLSession or URLSessionTasktask
The
URLSessionTask
that received the authentication challenge.