Instance Method

removeCredential:forProtectionSpace:options:task:

Removes the specified credential from the credential storage for the specified protection space, on behalf of the given task and using the given options.

Declaration

- (void)removeCredential:(NSURLCredential *)credential forProtectionSpace:(NSURLProtectionSpace *)protectionSpace options:(NSDictionary<NSString *,id> *)options task:(NSURLSessionTask *)task;

Parameters

credential

The credential to remove.

protectionSpace

The protection space from which to remove the credential.

options

A dictionary containing options to consider when removing the credential.

For possible keys, see Dictionary Key for Credential Removal Options. You should use this when trying to delete a credential that has the NSURLCredentialPersistenceSynchronizable policy.

task

The task using the protection space that you wish to remove the credential for.

Discussion

The credential is removed from both persistent and temporary storage.

See Also

Adding and Removing Credentials

- removeCredential:forProtectionSpace:

Removes the specified credential from the credential storage for the specified protection space.

- removeCredential:forProtectionSpace:options:

Removes the specified credential from the credential storage for the specified protection space using the given options.

- setCredential:forProtectionSpace:

Adds a credential to the credential storage for the specified protection space.

- setCredential:forProtectionSpace:task:

Adds a credential to the credential storage for the specified protection space, on behalf of the specified task.