---
title: "customScheme(_:)"
framework: authenticationservices
role: symbol
role_heading: Type Method
path: "authenticationservices/aswebauthenticationsession/callback/customscheme(_:)"
---

# customScheme(_:)

Creates a callback object that matches against URLs with the given custom scheme.

## Declaration

```swift
class func customScheme(_ customScheme: String) -> Self
```

## Parameters

- `customScheme`: The custom scheme that the app requires in the callback URL.

## Discussion

Discussion The following example creates a session that requires a callback with a custom URL scheme: let session = ASWebAuthenticationSession(     url: URL(string: "https://example.com/oauth/login/authorize")!,     callback: .customScheme("myappscheme") ) { callbackURL, error in     // Handle the session result. }

## See Also

### Creating callbacks

- [https(host:path:)](authenticationservices/aswebauthenticationsession/callback/https(host:path:).md)
