<!--
{
  "availability" : [
    "iOS: 12.0.0 - 27.0.0",
    "iPadOS: 12.0.0 - 27.0.0",
    "macCatalyst: 12.0.0 - 27.0.0",
    "macOS: 10.15.0 - 27.0.0",
    "tvOS: 16.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0",
    "watchOS: 6.2.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/ASWebAuthenticationSession/init(url:callbackURLScheme:completionHandler:)-7fpox",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Authentication Services"
    ],
    "preciseIdentifier" : "c:objc(cs)ASWebAuthenticationSession(im)initWithURL:callbackURLScheme:completionHandler:"
  },
  "title" : "init(url:callbackURLScheme:completionHandler:)"
}
-->

# init(url:callbackURLScheme:completionHandler:)

Creates a web authentication session instance.

```
init(url URL: URL, callbackURLScheme: String?, completionHandler: @escaping ASWebAuthenticationSession.CompletionHandler)
```

## Parameters

`URL`

A URL with the `http` or `https` scheme pointing to the authentication webpage.

`callbackURLScheme`

The custom URL scheme that the app requires in the callback URL.

`completionHandler`

A completion handler the session calls when it completes successfully, or when the user cancels the session.

## Discussion

---

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)