Jump to content

401 Authentication error when loading texture atlas png


mr_malee
 Share

Recommended Posts

Hi, seems after the latest Chrome update, images are failing to load due to an Authorization error.

 

http://stackoverflow.com/questions/19244006/chrome-basic-auth-image-requests-return-401-but-not-when-called-directly

 

Anyone know how I can get around this? Loading an image directly works, but then how to add that information, along with the atlas into pixi?

Link to comment
Share on other sites

the site is password protected not the images. After supplying the correct username and password the site loads.

 

Using pixi AssetLoader and adding a .json atlas file to it, once pixi starts trying to load the png defined in that .json, I get the 401 Authentication error.

So far this has only happened in Chrome and IE.

 

Firefox and Safair work.

Link to comment
Share on other sites

  • 2 months later...

Ok i think I have a solution to the problem. 

 

You need to set game.load.crossOrigin = 'use-credentials'

 

You also need to edit the xhrLoad method within loader.js and add the line this._xhr.withCredentials = true;

 

This will ensure that the request headers are updated with the correct authentication.

 

Info found from here:

 

https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...