---
title: "authenticationSessionRequest(_:didCancelWithError:)"
framework: authenticationservices
role: symbol
role_heading: Instance Method
path: "authenticationservices/aswebauthenticationsessionrequestdelegate/authenticationsessionrequest(_:didcancelwitherror:)"
---

# authenticationSessionRequest(_:didCancelWithError:)

Tells the delegate, typically a browser, that the authentication was canceled.

## Declaration

```swift
optional func authenticationSessionRequest(_ authenticationSessionRequest: ASWebAuthenticationSessionRequest, didCancelWithError error: any Error)
```

## Parameters

- `authenticationSessionRequest`: The request sending the message.
- `error`: An error that indicates the reason for the cancelation.

## See Also

### Responding to Completion Events

- [authenticationSessionRequest(_:didCompleteWithCallbackURL:)](authenticationservices/aswebauthenticationsessionrequestdelegate/authenticationsessionrequest(_:didcompletewithcallbackurl:).md)
