<!--
{
  "availability" : [
    "iOS: 16.4.0 - 27.0.0",
    "iPadOS: 16.4.0 - 27.0.0",
    "macCatalyst: 16.4.0 - 27.0.0",
    "macOS: 13.3.0 - 27.0.0",
    "tvOS: 16.4.0 - 27.0.0",
    "visionOS: 1.0.0 -",
    "watchOS: 9.4.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/WebAuthenticationSession/authenticate(using:callbackURLScheme:preferredBrowserSession:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Authentication Services",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:31_AuthenticationServices_SwiftUI03WebA7SessionV12authenticate5using17callbackURLScheme016preferredBrowserF010Foundation3URLVAJ_SSAC0lF0VSgtYaKF"
  },
  "title" : "authenticate(using:callbackURLScheme:preferredBrowserSession:)"
}
-->

# authenticate(using:callbackURLScheme:preferredBrowserSession:)

Begins a web authentication session.

```
@MainActor func authenticate(using url: URL, callbackURLScheme: String, preferredBrowserSession: WebAuthenticationSession.BrowserSession? = nil) async throws -> URL
```

## Parameters

`url`

A URL beginning with HTTP or HTTPS that points to the authentication webpage.

`callbackURLScheme`

The app’s custom callback scheme.

`preferredBrowserSession`

The preferred data-sharing behavior of the browser session. For more information, see [`WebAuthenticationSession.BrowserSession`](/documentation/AuthenticationServices/WebAuthenticationSession/BrowserSession).

## Return Value

The URL that the authentication provider returns.

## 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)