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

Provide a way to add HTTP Headers to the authenticate call #57

Open kylethompson-hs opened 1 year ago

kylethompson-hs commented 1 year ago

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.

ThexXTURBOXx commented 1 year ago

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

ThexXTURBOXx commented 1 year ago

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

ThexXTURBOXx commented 1 year ago

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

kwent commented 6 months ago

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

ThexXTURBOXx commented 6 months ago

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 commented 6 months ago

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)

kwent commented 6 months ago

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: @.***>