---
title: SFAuthenticationSession.CompletionHandler
framework: safariservices
role: symbol
role_heading: Type Alias
path: safariservices/sfauthenticationsession/completionhandler
---

# SFAuthenticationSession.CompletionHandler

The completion handler for an authentication session when the user cancels or finishes the login.

## Declaration

```swift
typealias CompletionHandler = (URL?, (any Error)?) -> Void
```

## Discussion

Discussion The custom callback URL should only be a custom URL scheme, and not a standard scheme (e.g. http or https). The session looks at the scheme registered first and routes to the app asking to start a session before potentially routing the scheme to another app.

## See Also

### Safari content in your app

- [Importing data exported from Safari](safariservices/importing-data-exported-from-safari.md)
- [SFSafariViewController](safariservices/sfsafariviewcontroller.md)
- [SFSafariSettings](safariservices/sfsafarisettings.md)
