Closed BoonHianLim closed 1 year ago
There have been other issues about http
and https
in this package already.
You have to not only set the callbackUrlScheme
inside the AndroidManifest.xml
to make them work, but also set a proper host and so on
Hi @ThexXTURBOXx,
Thank you for your prompt reply!
I have extensively reviewed the other open and closed issues related to the usage of http
and https
, particularly issues #24 and #27. I have made modifications to the code as suggested in those discussions, but unfortunately, the issue persists.
To illustrate, the following approach also does not yield the desired outcome:
data
label in AndroidManifest.xml
to <data android:scheme="https" android:host="example.windows.com" />
.main.dart
was adjusted to https://example.windows.com/?code=1337.callbackUrlScheme
in main.dart
to https.I suspect there might be a gap in my understanding of how to correctly utilize the package. Could you provide a clear example, or would you kindly review my commit on my fork where I made the said changes: https://github.com/BoonHianLim/flutter_web_auth_2/commit/933f1c9a6155b39f13792a61c973aeb382b2a8ff? I greatly appreciate your assistance.
Thank you in advance!
It could be worth trying to add either a path
or pathPrefix
to the scheme: https://stackoverflow.com/a/45782550/5894824
Here is also another example: https://github.com/cgeo/cgeo/blob/d7ab67629ac4798adaae194e563afe7df134fcd0/main/AndroidManifest.xml#L164
Describe the bug
When the
callbackUrlScheme
is set to either http or https, the package fails to listen to the redirect URL on the Android platform.To Reproduce
Steps to reproduce the behaviour:
callbackUrlScheme
inAndroidManifest.xml
to either http or https.main.dart
tohttp:/success?code=1337
orhttps://success?code=1337
.callbackUrlScheme
inmain.dart
to either http or https.I have also attempted different combinations, such as setting the
callbackUrl
tohttps://success?code=1337
while having thecallbackUrlScheme
set to http, and vice versa. However, these variations did not yield the desired result.Expected behaviour
I expected the package to successfully capture the redirect URL when using http or https as the
callbackUrlScheme
. However, it does not work in this case. Interestingly, if I use any other string as thecallbackUrlScheme
, such as 'example' or 'foobar', the package successfully captures the redirect URL without any issue.Screenshots
callbackUrlScheme
is set to http or https:As proof, the package works as expected when the
callbackUrlScheme
is set to any other string (e.g., 'example'):Device
flutter_web_auth_2
version: 2.1.5Checklist
Follow-up Questions
callbackUrlScheme
?Context
I am testing the usage of http and https as
callbackUrlScheme
because I am attempting to capture the OAuth token and OAuth verifier returned from the Garmin API during the OAuth 1.0a process. Unfortunately, the Garmin API only allows callback URLs to start with http or https and does not support custom URL schemes.