<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "macCatalyst: 17.4.0 -",
    "macOS: 14.4.0 -",
    "tvOS: 17.4.0 -",
    "visionOS: 1.1.0 -",
    "watchOS: 10.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/ASWebAuthenticationSession/Callback/https(host:path:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Authentication Services"
    ],
    "preciseIdentifier" : "c:objc(cs)ASWebAuthenticationSessionCallback(cm)callbackWithHTTPSHost:path:"
  },
  "title" : "https(host:path:)"
}
-->

# https(host:path:)

Creates a callback object that matches against HTTPS URLs with the given host and path.

```
class func https(host: String, path: String) -> Self
```

## Parameters

`host`

The host that the app requires in the callback URL. The host must be a member of a domain associated with the app, as described in <doc://com.apple.documentation/documentation/Xcode/supporting-associated-domains>.

`path`

The path that the app requires in the callback URL.

## Discussion

The following example creates a session that requires a callback with an `https://` URL:

```swift
let session = ASWebAuthenticationSession(
    url: URL(string: "https://example.com/oauth/login/authorize")!,
    callback: .https(host: "auth.example.com", path: "/auth/callback/example")
) { callbackURL, error in
    // Handle the session result.
}
```

---

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)