---
title: "urlProtocol(_:didCancel:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/urlprotocolclient/urlprotocol(_:didcancel:)"
---

# urlProtocol(_:didCancel:)

Tells the client that an authentication challenge has been canceled.

## Declaration

```swift
func urlProtocol(_ protocol: URLProtocol, didCancel challenge: URLAuthenticationChallenge)
```

## Parameters

- `protocol`: The URL protocol object sending the message.
- `challenge`: The authentication challenge that was canceled.

## See Also

### Handling authentication challenges

- [urlProtocol(_:didReceive:)](foundation/urlprotocolclient/urlprotocol(_:didreceive:).md)
