---
title: cancel()
framework: authenticationservices
role: symbol
role_heading: Instance Method
path: authenticationservices/aswebauthenticationsession/cancel()
---

# cancel()

Cancels a web authentication session.

## Declaration

```swift
func cancel()
```

## Mentioned in

Authenticating a User Through a Web Service

## Discussion

Discussion If the session has already presented a view with the authentication webpage, calling this method dismisses that view. Calling cancel() on an already canceled session has no effect.

## See Also

### Starting and Stopping a Session

- [canStart](authenticationservices/aswebauthenticationsession/canstart.md)
- [start()](authenticationservices/aswebauthenticationsession/start().md)
