<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/ASWebAuthenticationSessionRequestDelegate/authenticationSessionRequest(_:didCancelWithError:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Authentication Services"
    ],
    "preciseIdentifier" : "c:objc(pl)ASWebAuthenticationSessionRequestDelegate(im)authenticationSessionRequest:didCancelWithError:"
  },
  "title" : "authenticationSessionRequest(_:didCancelWithError:)"
}
-->

# authenticationSessionRequest(_:didCancelWithError:)

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

```
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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)