insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

HTTP 307 Redirect: Authentication information is not forwared

Open hflocken opened this issue 2 years ago • 2 comments

Expected Behavior

We call a REST URL via HTTP GET with the Authorization: Bearer header. As a response we get an HTTP 307 redirect to a different page. We would expect that all headers including the Authorization: Bearer header are forwarded to the new URL and that the correct response from the new URL is returned

Actual Behavior

The actual behavior is that the redirect to the new URL is performed and all headers except the Authorization: Bearer header are forwarded. However, as the new page is requiring authentication in the same way as the original URL, the call fails with an HTTP 401 error.

Reproduction Steps

The API is not public - therefore I cannot describe how somebody else could reproduce the issue.

Is there an existing issue for this?

Additional Information

No response

Insomnia Version

2023.4.0

What operating system are you using?

macOS

Operating System Version

Ventura 13.4.1

Installation method

Downloaded from the Insomnia page

Last Known Working Insomnia version

No response

hflocken avatar Aug 07 '23 12:08 hflocken

Is this on the roadmap? We are also facing this issue.

ericbf avatar Mar 23 '24 16:03 ericbf

This is standard; it's a default behaviour for browsers and even cURL itself (cURL did behave differently once upon a time however that was fixed). The reason is a failsafe for security - to prevent sensitive credentials being sent to unexpected/untrusted places if a server returns an unexpected redirect.

Not a bug but sounds like a good idea for a feature request I think. Perhaps an optional setting that can be toggled on or something.

git-commit-amen avatar Mar 28 '24 10:03 git-commit-amen