ASWebAuthenticationSessionWebBrowserSessionHandling begin callback not called for custom web handler app

I'm building a macOS app that registers itself for HTTP(S) url handling and would like it to participate in the ASWebAuthenticationSession fow.

I did:

  • update the plist to register as a handler for URL shemes (http, https, file)
  • use NSWorkspace setDefaultApplication API to set this app as a default handler for urls in question
  • wrote custom ASWebAuthenticationSessionWebBrowserSessionHandling implementation and set it as SessionManager's sessionHandler

I launched this app from Xcode, then I triggered authentication flow from a third-party app.

When the sign in flow is initiated, I can see that my app is activeated (willBecomeActive and didBecomeActive callbacks are both called), but there is no call for sessionHandler's begin() method.

With some additional debugging I see that my app receives an apple event when the flow is started:

{sfri,auth target=SafariLaunchAgent {qntp=90/$627......},aapd=TRUE

If I switch system default browser back to Safari and then start the login flow, it correctly displays a sign in web page. What do I miss?

PS. I'm on Tahoe 26.2

ASWebAuthenticationSessionWebBrowserSessionHandling begin callback not called for custom web handler app
 
 
Q