Skip to content
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

Error 401 - Authorization header is not passed in the redirected url after upgrading Chrome to version 119 #1208

Closed
1 of 4 tasks
laurent-inqom opened this issue Nov 7, 2023 · 39 comments

Comments

@laurent-inqom
Copy link

laurent-inqom commented Nov 7, 2023

Describe your issue?

Authorization header disapear from request headers when using replace string http rules. We identified that this issue happens after Chrome upgrade from 118 to 119 version. The http 'replace string' rules are used to redirect from my dev server to my localhost. We found a workaround that is using edge, but someone in the team has edge on version 119 and has the problem with Authorization header disapearing.

Repro steps

  1. Open the Requestly app.
  2. Create redirect rule (with a replace string rule).
  3. Use any http request with an authorization header that will trigger the replace string rule
  4. The Authorization header has vanished (resulting in 401 error for us).

What Requestly tool were you using?

  • Extension
  • Desktop-App
  • Android SDK
  • Selenium

Your Environment

Chrome (version 119) on Windows

Requestly Version

23.10.22

Error screenshot###

Error case, executed on chrome v119.0.6045.106

image
image

Ok case, on Edge v116.0.1938.69

image
image

As you can see, the Authorization header is automatically removed on our error case, as opposed to the OK case where everything is working as intended. Both set of screens were taken on the same environment, with the only diference being the browsers and its version (both being chromium am I right ?)
Thanks in advance for reading and for any help :visage_légèrement_souriant: !

@RLSilveira
Copy link

I have the same issue after upgrading Microsoft Edge to version 119.0.2151.44.

@brunomendeslima
Copy link

I'm experiencing this issue in Chrome Version 119.0.6045.106.

@golfyos
Copy link

golfyos commented Nov 8, 2023

I'm facing this issue as well after upgrading Chrome to the latest version (119.0.6045.105)

Authorization header is always missing.

I'm using Requestly via Chrome extension.

@sachinjain024
Copy link
Contributor

Thank you @laurent-inqom @golfyos @RLSilveira @golfyos for informing us about this issue. This looks like a recent change from the Chrome side.

We will follow up with the Chrome team about this. In the meantime, here is a work around :-

  1. Create a new HTTP Rule
  2. Select Modify HTTP Headers
  3. Add Request Header - Authorization and value should be copied from your other API request
  4. Save the Rule

I have created a SharedList for you here - https://app.requestly.io/rules#sharedList/1699438081127-Add-Authorization-to-localhost

I know it is not convenient (as it used to be earlier) but this should fix the issue for you temporarily.

image

@sachinjain024
Copy link
Contributor

We don't see anything suspicious in the Chrome 119 change log - https://developer.chrome.com/blog/new-in-devtools-119/ as well.

@sachinjain024 sachinjain024 changed the title Error 401 when upgrading Chrome to version 119 Error 401 - Authorization header is not passed in the redirected url after upgrading Chrome to version 119 Nov 8, 2023
@alphafast
Copy link

FYI, I work around by install an older version. It works as normal (I install version 117.0.5938.89)

@sagarsoni7
Copy link
Member

Chrome Enterprise release notes mentions this

Remove Authorization header upon cross-origin redirect back to top

The Fetch standard has been updated to remove Authorization header on cross origin redirects. Chrome 119 implements this change to the specification. Prior to Chrome 119, when a cross origin redirect, such as from foo.test to bar.test, happened with an Authorization header, Chrome preserved the Authorization header and bar.test could receive the header. Starting Chrome 119, Chrome removes Authorization headers when cross origin redirects happen, meaning that bar.test no longer receives the Authorization header.

Chrome 119 on ChromeOS, Windows, Mac, Linux, Android

@sachinjain024
Copy link
Contributor

I have created a simple Loom Video describing the issue - https://www.loom.com/share/f3af3e10154a4c9dae296dd3b7b62ea1

Steps to reproduce

  1. Install Requestly
  2. Import - https://app.requestly.io/rules#sharedList/1699448492370-Echo-Headers-from-Redirected-request
  3. Open API Client - https://app.requestly.io/api-client and Hit www.example.com

In Chrome v118 Authorization header is being passed while in Chrome v119 Authorization header is not passed.

@sachinjain024
Copy link
Contributor

sachinjain024 commented Nov 8, 2023

Chrome Enterprise release notes mentions this

Remove Authorization header upon cross-origin redirect back to top
The Fetch standard has been updated to remove Authorization header on cross origin redirects. Chrome 119 implements this change to the specification. Prior to Chrome 119, when a cross origin redirect, such as from foo.test to bar.test, happened with an Authorization header, Chrome preserved the Authorization header and bar.test could receive the header. Starting Chrome 119, Chrome removes Authorization headers when cross origin redirects happen, meaning that bar.test no longer receives the Authorization header.
Chrome 119 on ChromeOS, Windows, Mac, Linux, Android

@sagarsoni7 In this case, this is by design. We should check with the Chrome Extension team on how to handle this.

PS - Initiated a conversation - https://groups.google.com/a/chromium.org/g/chromium-extensions/c/jdHOIfz-hfQ/m/Mrxip6NHAgAJ

@masterminh219
Copy link

It seems that Firefox has the same behavior,

https://support.mozilla.org/pt-PT/questions/1405907

@nodkrot
Copy link

nodkrot commented Nov 16, 2023

Same here, started happening like a week ago

@rohanmathur91 rohanmathur91 unpinned this issue Nov 30, 2023
nafees87n added a commit that referenced this issue Dec 8, 2023
* #1208 Relay auth header to redirected request

* fix: init responseRuleHandler and removing temporary header

* fix: compatibility check for auth header banner

---------

Co-authored-by: Nafees Nehar <[email protected]>
@Sheikh566
Copy link

Any idea when this fix will be live? @sachinjain024

@nafees87n
Copy link
Contributor

Hey @Sheikh566
We have released a fix for this. We'll notify you once the new version is available in the chrome store.

@nafees87n
Copy link
Contributor

🚀 We have released the fix in v24.1.3. Make sure to update the extension.

@Sheikh566
Copy link

Using the latest version of Chrome, Firefox, and Requestly. But the header is still not forwarded.

@golfyos
Copy link

golfyos commented Jan 5, 2024

It's still not working. The header is not being forwarded as it was previously.

Chrome version: v120.0.6099.129 (Official Build) (arm64)
Requestly version: v24.1.3

@nafees87n
Copy link
Contributor

Hi @Sheikh566 @golfyos
Do you still get 401 error? Can you please share the logs and rule you are using?

@golfyos
Copy link

golfyos commented Jan 6, 2024

@nafees87n

rule:
Screenshot 2567-01-06 at 15 24 28

the request header when the rule is active
image

the partial request header when the rule is not active
image

response:
Screenshot 2567-01-06 at 15 23 21

my server log:
UnauthorizedError: Authorization required in header payload.

@nafees87n
Copy link
Contributor

@golfyos Can you please invoke the same fetch request (when the rule is active) once again after the page has loaded? I want to check if we have any race condition when the scripts are loaded and when the fetch request is fired.

@golfyos
Copy link

golfyos commented Jan 8, 2024

@nafees87n I've tried invoking the same fetch request after the page has loaded. Still not working

@Postremus
Copy link

@golfyos Any update? FTR. Authorization Header is still not forwarded.

@sachinjain024
Copy link
Contributor

Thanks, @Postremus, for bumping this up. We will investigate what could be happening here. Could you share a website where we can replicate this?

@nafees87n
Copy link
Contributor

nafees87n commented Feb 14, 2024

Hi
If anyone is available for a quick call to help us debug this issue, it would really help us in resolving it.
You can use this link to schedule a call with me. A debug build of the extension will be used in the call.
Thank you.

@nafees87n
Copy link
Contributor

Thanks @Postremus and @Sheikh566 for joining the call. It helped us identify the issue. We wouldn't have been able to do it without your help.
It seems that Authorization header is not forward in case of XHR cross origin redirects as well. We will fix this in the next release.

@Postremus
Copy link

@nafees87n Any update on getting this fix released?

@nafees87n
Copy link
Contributor

Hey @Postremus
Currently, we have our last release rolled out partially. Once that is released to 100% users, we plan to release this fix for all users by Friday.

@gerardog
Copy link

gerardog commented Mar 1, 2024

Awesome tool guys! please comment when this fix will be available! I am using the desktop version.

@Postremus
Copy link

Any updates? I am on version "24.2.17" of the chrome extension, still getting a 401.

@nafees87n
Copy link
Contributor

Hey @Postremus
The fix will be released in v24.3.5
We'll notify once it is available in the chrome store

@sachinjain024
Copy link
Contributor

We have rolled out this in v24.3.5, which is at the 50% rollout stage. If no issues are reported further, we will make a 100% rollout by tomorrow.

@totoberg123
Copy link

totoberg123 commented Mar 11, 2024

@nafees87n @sachinjain024 I am having the same issue on the Desktop App (Windows 11). I am logging traffic using the built-in proxy server. When using a Redirect or Modify URL Rule the 'Authorization' header is not being passed.

Edit:
I created an issue: requestly/requestly-desktop-app#71

@Postremus
Copy link

I can confirm I am no longer getting the 401 with v24.3.5

@nafees87n
Copy link
Contributor

Thanks for the confirmation @Postremus . Glad to know that it works

@sachinjain024
Copy link
Contributor

This has been rolled out to 100% now.

@sachinjain024
Copy link
Contributor

@nafees87n @sachinjain024 I am having the same issue on the Desktop App (Windows 11). I am logging traffic using the built-in proxy server. When using a Redirect or Modify URL Rule the 'Authorization' header is not being passed.

Edit: I created an issue: requestly/requestly-desktop-app#71

Thanks for reporting this. We will pick this up soon in the upcoming week. cc @nsrCodes

@sachinjain024
Copy link
Contributor

Closing this issue as this has been rolled out completely. We will work on separate ticket for solving this in the desktop app.

@sachinjain024 sachinjain024 unpinned this issue Apr 3, 2024
@vitolrosario
Copy link

Hey, i started getting this issue a few weeks ago and recently discovered that the extension is the cause.

I'm runnng 126.0.6478.62 on chrome and 24.5.27 on requestly.

Weird thing is, it happens even if no rules are active, only by having the extension activated. if i deactivate it, it works.

@nafees87n
Copy link
Contributor

Hey @vitolrosario
What error are you getting?

This issue is about authorization header not getting forwarded in case of cross-origin redirects using Requestly redirect rule. Feel free to open a new issue here if you are encountering any issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests