flutter_web_auth_2 icon indicating copy to clipboard operation
flutter_web_auth_2 copied to clipboard

Provide a way to add HTTP Headers to the authenticate call

Open kylethompson-hs opened this issue 2 years ago • 7 comments
trafficstars

I'm using this package to authenticate with my backend server. I'd like to be able to pass some header values along with the URL open call to my server. As far as I can tell this isn't supported today.

kylethompson-hs avatar Aug 10 '23 16:08 kylethompson-hs

That sounds like a great feature request which I will take a look at after my vacation (in around two to three weeks)! 😊

ThexXTURBOXx avatar Aug 10 '23 19:08 ThexXTURBOXx

I have a huge refactor planned which should be able to tackle this task. However, it will need quite some time

ThexXTURBOXx avatar Aug 26 '23 20:08 ThexXTURBOXx

The huge refactor is online in version 3.0.0-alpha.1. However, there seems to be very limited support for headers from url_launcher's side of things. Due to this, I will postpone this a bit more until I find a better solution to make url_launcher accomplish that

ThexXTURBOXx avatar Aug 27 '23 20:08 ThexXTURBOXx

Looks like url_launcher supports headers now https://pub.dev/documentation/url_launcher/latest/url_launcher/launch.html

kwent avatar Mar 13 '24 14:03 kwent

https://pub.dev/documentation/url_launcher/latest/url_launcher/WebViewConfiguration/headers.html

"Not all browsers support this, so it is not guaranteed to be honored."

Additionally, it is restricted to Android only. But I have already implemented this a few weeks ago in my local build of the 4.0.0 alpha - so the next preview will at least support this on Android.

ThexXTURBOXx avatar Mar 13 '24 15:03 ThexXTURBOXx

I just wanted to push my changes, but I noticed that they are not even applied on Android since we are not using url_launcher on Android - in favor of a native solution. Hence, this is still not possible (and the headers parameter @kwent mentioned was already available when this issue was created and I was even aware of it)

ThexXTURBOXx avatar Mar 13 '24 16:03 ThexXTURBOXx

Sounds good thanks for being on top of this and clarifying the situation!

On Wed, Mar 13, 2024 at 9:40 AM Nico Mexis @.***> wrote:

I just wanted to push my changes, but I noticed that they are not even applied on Android since we are not using url_launcher on Android - in favor of a native solution. Hence, this is still not possible (and the headers parameter @kwent https://github.com/kwent mentioned was already available when this issue was created and I was even aware of it)

— Reply to this email directly, view it on GitHub https://github.com/ThexXTURBOXx/flutter_web_auth_2/issues/57#issuecomment-1994928097, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGWZJC2MWDY3R7R3GZ7ZVLYYB6OZAVCNFSM6AAAAAA3LYWWTOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJUHEZDQMBZG4 . You are receiving this because you were mentioned.Message ID: @.***>

kwent avatar Mar 13 '24 16:03 kwent