ThexXTURBOXx / flutter_web_auth_2

Flutter plugin for authenticating a user with a web service
https://pub.dev/packages/flutter_web_auth_2
MIT License
51 stars 50 forks source link

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

Open alexboulay opened 3 weeks ago

alexboulay commented 3 weeks ago

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

ThexXTURBOXx commented 3 weeks ago

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

alexboulay commented 3 weeks ago

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.

ThexXTURBOXx commented 3 weeks ago

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