Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Joon · Oct 09, 2010 at 07:21 PM · texturesecuritycrossdomain

Security Policy conflicts with non-crossdomain textures

I am making a game that utilizes GetPixel to build a billboard for 3D object. It worked fine with Unity2.x but now that I'm trying to upgrade the engine to Unity3 it began to conflict with the cross domain policy.

The problem is that I am downloading some external images for GUI usage -- to be more specific user photos from Facebook. I DO NOT utilize these in making billboards -- I use it only for GUI and no 3D object uses them. Yet I'm getting an exception when calling GetPixel using the render target texture. The exception message is as followed:

System.Security.SecurityException: Reading from the screen is not allowed when you have used a downloaded texture without proper crossdomain.xml authorization

Shouldn't unity check whether textures without crossdomain.xml are actually used for the scene rendering and generate such exception? Is there any workaround for this kind of problem?

I would appreciate any comments. Thanks!

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Rupe-CS · Jul 10, 2013 at 03:09 PM 0
Share

I'm co$$anonymous$$g up against this too. I've been assu$$anonymous$$g that it's because Unity can't be sure of the ultimate source of screen data so once you've downloaded something that's potentially risky it forbids all such operations. But if that's not the case and there is some kind of workaround it'd be extremely handy!

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by tw1st3d · Jul 10, 2013 at 03:14 PM

I'm not finding a whole lot on the subject, but it looks like you need to write the .xml file. A small example of a fix is provided below.

         sys.puts( "policy file requested\n");
         socket.write("<cross-domain-policy>\n");
         socket.write('<allow-access-from domain="*" to-ports="*" />\n');
         socket.write("</cross-domain-policy>\n");
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Rupe-CS · Jul 10, 2013 at 03:22 PM 0
Share

Thanks. Obviously (and I guess in the OP Joon's case) one doesn't always have access to the server which needs to be hosting the crossdomain.xml. I'm in the process of trying to get it hosted by my 3rd party which would be the "right" solution.

But this UnityAnswers question was the only thing I found referencing the issue hence my resurrecting it with my comment above. For the sake of fuller understanding, I'd be really interested if anyone's able to confirm WHY Unity appears to need to deny all such operations as soon as you download an image without the crossdomain policy (it does so even if I destroy the downloaded texture immediately after downloading it).

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Assigning UV Map to model at runtime 0 Answers

Cross-domain policy for specific folder/URL 1 Answer

crossdomain.xml on Server Requiring Basic Authorization 0 Answers

UNITY 5 PBR - Metallic + Smoothness black? 1 Answer

Max to Unity baked texture issue. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges