Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue prompting for authentication on OSX with Chrome as default browser #13

Closed
Jack64 opened this issue Sep 26, 2022 · 5 comments
Closed
Assignees
Labels
apple [See issue #68] Just Apple being Apple again... bug Something isn't working hacktoberfest Fixing this issue will get you one PR closer to completing Hacktoberfest :)

Comments

@Jack64
Copy link

Jack64 commented Sep 26, 2022

Describe the bug

This is a re-post of LinusU#136 .

When using flutter_web_auth v0.4.1 (or flutter_web_auth_2 on v1.1.2) on Darwin OSX (12.5.1) targets that have the default browser set to Chrome (Version 105.0.5195.102 (Official Build) (x86_64)), the authentication prompt opens and closes immediately afterwards, causing a PlatformException. If the default browser is set to Safari, the authentication flows work as expected.

To Reproduce

Steps to reproduce the behavior:

  1. Set Chrome as default browser in OSX
  2. Start the authentication flow with the default browser (Chrome), using flutter_web_auth v0.4.1
  3. See the chrome window open and immediately close
  4. Stack trace:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(EUNKNOWN, The operation couldn’t be completed. (com.apple.AuthenticationServices.WebAuthenticationSession error 3.), null, null)
#0      StandardMethodCodec.decodeEnvelope
package:flutter//services/message_codecs.dart:653
#1      MethodChannel._invokeMethod
package:flutter//services/platform_channel.dart:296
<asynchronous suspension>
#2      FlutterWebAuth2MethodChannel.authenticate
package:flutter_web_auth_2_platform_interface/flutter_web_auth_2_method_channel.dart:14
<asynchronous suspension>
#3      auth2

Expected behavior

The Chrome window should have opened on the correct URL, instead of not opening at all (when Chrome is already open) or opening on the "Chrome Profile Selection Page".

Screenshots

N/A

Device (please complete the following information!)

  • Device: MacBook Pro
  • OS: Darwin 12.5.1 and 12.6
  • Browser: Chrome
  • flutter_web_auth_2 version: 1.1.2

Additional context

N/A

@Jack64 Jack64 added the bug Something isn't working label Sep 26, 2022
@ThexXTURBOXx
Copy link
Owner

Wow, Apple is really causing many problems (as always lol)...
According to the documentation this means that the context was invalid.
And I think the context being meant is this one.
It is also very nice to see that Apple does not care about such issues as seen here since noone responded to some guy having the exact same problem :)
Enough about the Apple-rant - alas I do not own any Apple-device, so I am unable to debug this any further. But if someone else is willing to do this, he is of course free to do so.
Thanks for the detailed bug report btw!

@ThexXTURBOXx ThexXTURBOXx added the hacktoberfest Fixing this issue will get you one PR closer to completing Hacktoberfest :) label Sep 26, 2022
@ThexXTURBOXx
Copy link
Owner

I tagged this PR as being part of Hacktoberfest.
So, if someone is able to fix and properly test this issue, he is one step closer to completing Hacktoberfest 2022 :)

@Jack64
Copy link
Author

Jack64 commented Sep 27, 2022

Thanks for the quick feedback, however it is unfortunate that this is the status quo.

I'm unsure if this is an Apple issue or a Chrome issue.

Just for the sake of testing this a bit further, I downloaded Firefox and ran the same scenario... it is handled differently: when I set firefox as my default browser, the ASWebAuthenticationSession pop-up requests that you open the link with Safari, exactly that same as if Safari were the default browser. Perhaps this is more a Chrome issue rather than an Apple issue and this information might help whoever picks this up.

In any case, here's another instance of the same issue reported to Apple to which they did not respond :)

@Knupper
Copy link

Knupper commented Nov 10, 2022

I have tested it now multiple times with the newest 2.0.2 under mac os 13 and with chrome 107 and it works as it should. Can you may test it again with the newest version of this package?

@ThexXTURBOXx
Copy link
Owner

Closing this due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apple [See issue #68] Just Apple being Apple again... bug Something isn't working hacktoberfest Fixing this issue will get you one PR closer to completing Hacktoberfest :)
Projects
None yet
Development

No branches or pull requests

3 participants