[IOS/MacOS] credentials: "include"
not working with InAppWebView
to refresh token in Steam Login
#2541
Open
1 of 2 tasks
Labels
bug
Something isn't working
Is there an existing issue for this?
Current Behavior
I found something about this
In our Flutter application, we are using
flutter_inappwebview
to handle the Steam login flow. The Steam API requires sending a request to refresh the JWT token, which works manually in the browser. However, when usingInAppWebView
, the credentials are not being sent with the request, causing asuccess: false, error: 21
response, which indicates that the cookies (which are needed for authentication) are not included in the request.We are using the following code to attempt refreshing the token in the
onLoadStop
callback of theInAppWebView
:However, the
credentials: "include"
is not working as expected, and the cookies are not being sent with the request. The response we receive is:Expected Behavior:
The credentials should be properly included in the request, and the token should be refreshed successfully, as it works in a standard browser.
Actual Behavior:
The request to refresh the token fails with
error: 21
, indicating that the credentials (cookies) are not sent with the request.Steps to Reproduce:
flutter_inappwebview
to navigate to the Steam login URL.fetch
call to refresh the token in theonLoadStop
callback."success": false, "error": 21
.Possible Solution:
It seems like there might be an issue with the way cookies are being handled in
flutter_inappwebview
. We suggest investigating the handling of cookies and the use of thecredentials
property in HTTP requests, particularly in WebViews.Additional Information:
Here is an example of how the request is structured:
We are looking for a solution to properly include the credentials (cookies) when making this request in a WebView.
Expected Behavior
The credentials should be properly included in the request, and the token should be refreshed successfully, as it works in a standard browser.
Steps with code example to reproduce
Steps with code example to reproduce
Stacktrace/Logs
Stacktrace/Logs
Flutter version
3.24.5
Operating System, Device-specific and/or Tool
MacOS
IOS
Android : works as expected
Plugin version
v6.1.5
Additional information
No response
Self grab
The text was updated successfully, but these errors were encountered: