aframevr / aframevr/aframe

Support for credentialed resource request

Open
#3,874 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
17.6k
Forks
4.4k
PR merge metrics
No merged PRs in 30d

Description

Description:
Can't load asset that needs withCredentials XMLHttpRequest.

  • A-Frame Version: latest
  • Platform / Device: every
  • Reproducible Code Snippet:
<a-assets>
<a-asset-item id="model" src="asset_url_with_cookie_auth"></a-asset-item>
</a-assets>

Solution:
THREE.FileLoader needs to have a method to set credentials

this.fileLoader.setWithCredentials(true)

right before:
https://github.com/aframevr/aframe/blob/4a44a804bbf7347e41fdc88daa6fa1d68756029d/src/core/a-assets.js#L109

https://threejs.org/docs/#api/en/loaders/FileLoader.setWithCredentials

https://github.com/aframevr/aframe/pull/1647/commits/fedf28b42ae4f9b9cdc40202af68d9e69a86473b

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/core/a-assets.js around the asset-loading code at line 109 and review THREE.FileLoader.setWithCredentials in the linked three.js documentation. Verify that an asset URL requiring cookie authentication can load with credentials enabled, and add or update coverage if the surrounding code provides a relevant test location.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, three.js
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.