flutter_web_auth_2 icon indicating copy to clipboard operation
flutter_web_auth_2 copied to clipboard

[Bug]: Using universal links with preferEphemeral true does not work

Open alexboulay opened this issue 1 year ago • 3 comments
trafficstars

Description

First, thank you for this project, it helps us a lot.

I have noticed that the redirect (closing of the auth pop-up) does not work when using universal links on iOS when preferEphemeral is set to false. It does however work with true.

Not sure if this is related to ASWebAuthenticationSession or this Flutter package.

In any case, I would appreciate if some light can be shed on why this happens.

Thank you.

Minimal Reproduction

Steps to reproduce the behaviour:

Set up Universal Links Use FlutterWebAuth2 with preferEphemeral set to false Notice you wont get redirected once the auth flow is completed.

Exception or Error

No Exception.

Expected Behaviour

Should redirect regardless of preferEphemeral is true or false

Screenshots

No response

Additional context

No response

Device

iPhone

OS

17.4

Browser

NA

Flutter version

3.24.0

flutter_web_auth_2 version

3.1.2

Checklist

  • [X] I have read and followed the entire troubleshooting guide and it has not provided the solution I need.
  • [X] I have provided all the information I can.

alexboulay avatar Aug 28 '24 18:08 alexboulay

Just supplying version "latest" or "stable" does not help. Please specify exactly which version. Also try out the latest preview (4.x)

ThexXTURBOXx avatar Aug 29 '24 16:08 ThexXTURBOXx

I updated my question to specify the versions.

I will try out 4.x soon.

In the meantime, I just want to add that I made my post immediately after trying out Microsoft OAuth flow.

I then tried Google but the redirect inside the app did not work, regardless of using preferEphemeral. The window did not close and it only redirected to my actual domain within the window. Then, I tried to configure Google OAuth with a custom scheme and it worked fine. I think I officially hate implementing OAuth flows and to think I am only doing this high-level makes me even more grateful for your work.

alexboulay avatar Aug 29 '24 17:08 alexboulay

You're welcome :) 4.x actually supports the new authentication functions from newer versions of the SDK - maybe that fixes your problem!

ThexXTURBOXx avatar Aug 29 '24 19:08 ThexXTURBOXx