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
URLCredentialobject for the authentication challenge. The conforming class should also be registered with APIRequestType protocol for it to actually be called.See also
APIRequestTypeDeclaration
Swift
static func credential(forChallenge challenge: URLAuthenticationChallenge, onTask task: URLSessionTask) -> URLCredential?Parameters
challengeThe
URLAuthenticationChallengereceived by the URLSession or URLSessionTask.taskThe
URLSessionTaskthat received the authentication challenge.
URLCredentialProvider Protocol Reference