Instance Method

getDefaultCredentialForProtectionSpace:task:completionHandler:

Gets the default credential for the specified protection space, which is being accessed by the given task, and passes it to the provided completion handler.

Declaration

- (void)getDefaultCredentialForProtectionSpace:(NSURLProtectionSpace *)space task:(NSURLSessionTask *)task completionHandler:(void (^)(NSURLCredential *credential))completionHandler;

Parameters

space

The protection space of interest.

task

The task seeking to use the protection space

completionHandler

A completion handler that receives the default credential as its argument, or nil if there is no default credential for this combination of protection space and task.

See Also

Getting and Setting Default Credentials

- defaultCredentialForProtectionSpace:

Returns the default credential for the specified protection space.

- setDefaultCredential:forProtectionSpace:

Sets the default credential for a specified protection space.

- setDefaultCredential:forProtectionSpace:task:

Sets the default credential for a given protection space, which is being accessed by the given task.