8

In Safari browser, Authorization header is getting scraped when request is redirected. It is working in all other browser like Chrome, IE.

I am doing one ajax call where I pass the Authorization header, this API redirect to the other API, with status code 302, in all other browser Authorization Header is persisted when request is redirected. but in safari browser it is not persisted so the redirected API gives 401 unauthorized response.

I am using safari 12.1.2 version. I have also tried to change the request redirect mode by setting requestOptions.redirect to manual and handling redirection manually but that also not worked, it was giving 401 in that model also.

Any one have faced this type of issue ? I have referred multiple resources but not found any solution.

Please Help.

Ankit Prajapati
  • 2,670
  • 2
  • 12
  • 22
  • I've seen this as well. Are there are relevant response headers that come back in the 30x? – Randy Hudson Dec 13 '19 at 17:41
  • I am seeing the same thing. Works on Chrome, but not on Safari. – vaughan Apr 18 '20 at 11:32
  • I'm having exactly the same problem with Safari. Chrome and Firefox work just fine. Did you find a workaround or any additional info on this? – ptkvsk Aug 18 '20 at 10:44
  • @ptkvsk , We have implemented other workaround for this. We have implemented cookie based authentication later on. – Ankit Prajapati Aug 19 '20 at 08:29
  • It seems a fix for this was merged in October: https://github.com/WebKit/WebKit/commit/8cfdff34446111a6798d0cbcff494322fd14dd69 — and per https://bugs.webkit.org/show_bug.cgi?id=230935#c18 it shipped in Safari 15.4 (iOS 15.4 and macOS 12.3). – sideshowbarker May 18 '22 at 08:09

0 Answers0