---
title: "authenticate(using:callbackURLScheme:preferredBrowserSession:)"
framework: authenticationservices
role: symbol
role_heading: Instance Method
path: "authenticationservices/webauthenticationsession/authenticate(using:callbackurlscheme:preferredbrowsersession:)"
---

# authenticate(using:callbackURLScheme:preferredBrowserSession:)

Begins a web authentication session.

## Declaration

```swift
@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 doc://com.apple.authenticationservices/documentation/AuthenticationServices/WebAuthenticationSession/BrowserSession.

## Return Value

Return Value The URL that the authentication provider returns.
