maui icon indicating copy to clipboard operation
maui copied to clipboard

WebAuthenticator iOS/MacCatalyst uses Default Web Browser (rejected by App Store reviewer)

Open tekmun opened this issue 10 months ago • 6 comments

Description

According to this website (https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/communication/authentication), iOS12 and higher uses ASWebAuthenticationSession, which should be Safari browser instead of the default web browser. Unfortunately, this is untrue. When I change the default web browser to another browser (eg. Firefox), the authentication session opens Firefox browser. I tried it with Facebook and Google sign-ins. Apple Sign-in has no issue because I use the AppleSignIn solution. The App Store Review rejects my app because it opens a default web browser instead of Safari.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.3 GA

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

MacOS 14.4.1

Did you find any workaround?

No.

Relevant log output

No response

tekmun avatar Apr 17 '24 01:04 tekmun

In the code folder maui/src/Essentials/src/WebAuthenticator, there are two separate files for iOS/TVOS and macOS. The contents are quite different. Could this be the reason on macOS, the default web browser is used instead of "ASWebAuthenticationSession"?

tekmun avatar Apr 17 '24 23:04 tekmun

On line 73 in WebAuthenticator.ios.tvos.cs (https://github.com/dotnet/maui/blob/main/src/Essentials/src/WebAuthenticator/WebAuthenticator.ios.tvos.cs), there is an if condition. (OperatingSystem.IsIOSVersionAtLeast(12)) Could this be the reason why it does not open ASWebAuthenticationSession but the default browser on MacCatalyst?

tekmun avatar Apr 26 '24 13:04 tekmun

This bug is blocking my submission to the AppStore for MacCatalyst. This if statement (OperatingSystem.IsIOSVersionAtLeast(12)) may be blocking the MacCatalyst app from utilising ASWebAuthenticationSession. Can this conditional statement be expanded to include MacCatalyst in the next release?

tekmun avatar May 01 '24 00:05 tekmun

Is there an update on this bug? I am unable to submit my app to the Mac Store. Kindly help. Thanks.

tekmun avatar May 16 '24 00:05 tekmun

I created this PR and will try and get the code compiling, but I have not tested anything yet: https://github.com/dotnet/maui/pull/22739

Once the build is complete, you should be able to test and let us know if it works as expected. Once we know, we can merge and it will appear in the releases.

mattleibow avatar May 30 '24 17:05 mattleibow

@tekmun have you been able to test the artifacts from the PR?

mattleibow avatar Jun 05 '24 19:06 mattleibow