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
Address #173 by adding support for web redirect auth flows #174
Conversation
Hi, We've merged this pull request, but we are seeing an error message in the console when login with "web redirect". @stevenebutler do you know anything about this error? Everything works fine even with this message.
|
Hi,
I just tried logging into my app using this patch on a chrome desktop
browser with dev tools open and did not see any such error.
Is this happening when you haven’t yet logged in or when the redirect back
into the app occurs with the token? Perhaps in some cases the redirect is
causing an error in the dart runtime?
It does effectively terminate the app while auth happens because it has
redirected but there may be some js code still running when that happens
that tries to access resources that have been cleaned up?
I’m not sure though TBH.
When I was writing this PR, I did find I got errors when I used the
absolute latest MSAL library, but the sample application update uses a
version that worked well for me.
…On Thu, 24 Nov 2022 at 9:19 pm, jmv ***@***.***> wrote:
Hi,
We've merged this pull request, but we are seeing an error message in the
console when login with "web redirect". @stevenebutler
<https://github.com/stevenebutler> do you know anything about this error?
Everything works fine even with this message.
Error: Assertion failed:
org-dartlang-sdk:///flutter_web_sdk/lib/_engine/engine/navigation/history.dart:215:12
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart
266:49 throw_
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart
29:3 assertFailed
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/navigation/history.dart
215:28 tearDown
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart
84:54 runBody
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart
123:5 _async
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/navigation/history.dart
206:24 tearDown
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/window.dart
88:28 _useSingleEntryBrowserHistory
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart
84:54 runBody
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart
123:5 _async
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/window.dart
68:45 [_useSingleEntryBrowserHistory]
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/window.dart
164:17 <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart
84:54 runBody
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart
123:5 _async
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/window.dart
156:27 <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/window.dart
148:30 _waitInTheLine
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart
45:50 <fn>
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart
1653:54 runUnary
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart
147:18 handleValue
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart
766:44 handleValueCallback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart
795:13 _propagateToListeners
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart
430:9 callback
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart
40:11 _microtaskLoop
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart
49:5 _startMicrotaskLoop
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart
166:15 <fn>
—
Reply to this email directly, view it on GitHub
<#174 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEADFJMZ3HJHSVU3LJ2H2XTWJ5FLHANCNFSM6AAAAAARAQRR4U>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This PR addresses #173 by adding a non-default option for redirect auth flows to flutter web apps.
This resolves an issue with being completely unable to login on iOS devices with home-screen installed PWAs made from a flutter app due to the authentication popup and the PWA web sandbox being isolated from each other.
It is possible to change the type of authentication by changing the option in the configuration after it is created.
My testing showed that an update to the MSAL library is required for this patch to work with the example application.
When using redirect flow, it is important to call login() again after the application is reloaded, following the completion
of the redirect authentication flow, or the token acquisition will not have been completed. If the application triggers a
login()
whenever it first loads to acquire a token, this will be transparent to the user.
Closes #173
Closes #171