---
title: "webView(_:resource:didReceive:from:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webresourceloaddelegate/webview(_:resource:didreceive:from:)-54xbd"
---

# webView(_:resource:didReceive:from:)

Invoked when an authentication challenge has been received for a resource.

## Declaration

```swift
optional func webView(_ sender: WebView!, resource identifier: Any!, didReceive challenge: URLAuthenticationChallenge!, from dataSource: WebDataSource!)
```

## Parameters

- `sender`: The web view that sent this message.
- `identifier`: An identifier object used to track the resource being loaded by dataSource.
- `challenge`: The authentication challenge that was received.
- `dataSource`: The data source for this web view.

## See Also

### Authenticating Resources

- [webView(_:resource:didCancel:from:)](webkit/webresourceloaddelegate/webview(_:resource:didcancel:from:).md)
