Bug #83741
closed
HTTP Basic Authentication credentials in Google Chrome 64 not transfered to AJAX calls in d3.js
Added by Marco Huber almost 7 years ago.
Updated about 6 years ago.
Category:
Backend JavaScript
Description
Our project is protected by a HTTP Basic Authentication and we have to enter the username/password on every d3.json() call in Google Chrome. In TYPO3 8.7 this function is called in the SvgTree.js to build the tree in the tt_content/categories field, in TYPO3 9.x it's called for every(?) tree.
This is a bug in the d3.js (4.10) library, but it affects every TYPO3 8.7 and 9.x. An Update to d3.js 4.13 doesn't help and in d3.js 5.0 there is a similar issue.
https://github.com/d3/d3-request/issues/33
https://github.com/d3/d3-fetch/issues/10
A dirty workaround would be, to set the credentials with some javascript workaround. But I'm not sure if this is the right way. Berhaps the d3.js developers have some ideas on github.
Files
The problem that Marco described started with Google Chrome 64 which had some changes regarding the handling of basic auth credentials in URLs.
Attached is a screenshot which shows the problem.
- Category set to Backend JavaScript
How to reproduce:
TYPO3 8.7:
- add basic auth protection to the TYPO3 backend or the whole site
- use at least Google Chrome 64
- try to add/edit a content element or page properties
=> you're directly prompted for credentials again
TYPO3 9.x
- add basic auth protection to the TYPO3 backend or the whole site
- use at least Google Chrome 64
- try to open any module that contains the page tree or try to refresh the page tree
=> you're directly prompted for credentials again
- Related to Feature #76108: Refactor Category tree to be based on SVG added
- Description updated (diff)
One solution would be to migrate to v5 and change the d3.json (swicthing also request component from d3-request to d3-fetch where you can pass configuration options like
d3.json("path/to/file.json", {credentials: "include"});
Another solution would be to patch d3 manually like in my pull request:
https://github.com/d3/d3-request/pull/34/files
- Status changed from New to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
What needs to be done to backport this patch for TYPO3 8.7 as well? On Feb 6th, the next patch release for TYPO3 8.7 is scheduled and it would be great to have this patch in the next release!
- Target version set to 8.7.10
- Status changed from Resolved to Accepted
- Status changed from Accepted to Under Review
- Status changed from Under Review to Resolved
- Status changed from Resolved to Closed
- Related to Task #93186: Use AjaxRequest instead of broken d3.request added
Also available in: Atom
PDF