From the docs - https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession/2990952-init:
callbackURLScheme
The custom URL scheme that the app expects in the callback URL. Note "custom" URL scheme, which will allow ASWebAuthenticationSession to redirect back to your app and complete.
If you need to redirect back to your app with an http(s) URL from an external user agent—that is, an authentication class like ASWebAuthenticationSession or a system browser—you'll need to do it on the OS level by using Universal Links - https://developer.apple.com/documentation/xcode/allowing_apps_and_websites_to_link_to_your_content.
It's a big subject covered in the aforementioned doc and others referenced from there. In short, your redirection URI will point to a server where your apple-app-site-association file is hosted and a path specified for your app in this file. Then you'll need to handle the redirection in your app delegate's application(_:continue:restorationHandler:) method. You will also need to manually cancel your ASWebAuthenticationSession, as it will not complete on an http(s) redirection.
I described a Universal Link implementation here: h ttps://developer.forgerock.com/docs/platform/how-tos/implementing-oauth-20-authorization-code-grant-protected-pkce-appauth-sdk-ios#simple-app-universal-links
It was written a while ago and in the context of an OAuth 2 client built on top of the AppAuth SDK for iOS, but could still be a relevant compliment to the docs.
Topic:
App & System Services
SubTopic:
Core OS
Tags: