---
title: "cancel(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/urlauthenticationchallengesender/cancel(_:)"
---

# cancel(_:)

Cancels a given authentication challenge.

## Declaration

```swift
func cancel(_ challenge: URLAuthenticationChallenge)
```

## Parameters

- `challenge`: The authentication challenge to cancel.

## See Also

### Related Documentation

- [URL Loading System](foundation/url-loading-system.md)

### Protocol Methods

- [continueWithoutCredential(for:)](foundation/urlauthenticationchallengesender/continuewithoutcredential(for:).md)
- [use(_:for:)](foundation/urlauthenticationchallengesender/use(_:for:).md)
- [performDefaultHandling(for:)](foundation/urlauthenticationchallengesender/performdefaulthandling(for:).md)
- [rejectProtectionSpaceAndContinue(with:)](foundation/urlauthenticationchallengesender/rejectprotectionspaceandcontinue(with:).md)
