Cross domain issue found in Wrapper IMA SDK

1,266 views
Skip to first unread message

Sunil Kumar

unread,
Dec 30, 2015, 9:23:44 AM12/30/15
to ima...@googlegroups.com, ima-sdk...@google.com, ima-sdk-a...@google.com
Hi 

I am facing issue of cross domain while testing it from localhost. I am requesting Adtech calls for ads but it is giving me wrapper ads and after parsing it I retrieve below URL and passing it to adsRequest.adTagUrl but it is giving cross domain issue and some time it failed to load and gives error. 


Please find the attached screenshot for your reference. 

Please advise on this. 


Best regards,
Sunil Kumar



Crossdomain issue.PNG

Vu Chau (IMA SDK Team)

unread,
Dec 30, 2015, 9:51:39 AM12/30/15
to Interactive Media Ads SDK, ima-sdk...@google.com, ima-sdk-a...@google.com, suni...@gmail.com
Hi Sunil,

It looks like the script imasdk.googleapis.com is blocked from being used by your implementation, because the latter is a localhost.  It's a CORS issue, for which we have a section in our docs that should help you address it.

Let me know if that solves the issue,

Vu Chau
IMA SDK Team

Sunil Kumar

unread,
Jan 6, 2016, 8:36:14 AM1/6/16
to Vu Chau (IMA SDK Team), Interactive Media Ads SDK, ima-sdk...@google.com
Hi Vu Chau,

Thanks a lot for your kind support. I have checked  document and found google IMA SDK URL has not set CORS at their end. This is suppose to be done at server side at below mention URL which I am loading in my player to play ads. 

Can you please review below scenario and advise us how to solve this problem? 



Here I need only JavaScript file to play ads in my IMA SDK in HTML5 player. But the above URL is working fine and giving all access and showing all controls in Response Header. 
  1. Successfully found - access-control-allow-credentials:
    true
  2. Successfully found -
    access-control-allow-origin:
    *
 But when I load below URL in my IMA SDK it is giving me error of cross domain. 


Error - 304 no Response header set - 

Can you please advise what is wrong in my implementation? Also can you please check at your end and see if you can play ads in IMA SDK from above URL which response is 304. If you think that the URLs need to set CORS value please advise to whom should I contact to solve this problem. 


Again thanks a lot for your valuable time to support us. 

Best regards,
Sunil Kumar






Sunil Kumar

unread,
Jan 6, 2016, 8:46:23 AM1/6/16
to Vu Chau (IMA SDK Team), Interactive Media Ads SDK, ima-sdk...@google.com
Continue to my previous message - 

Please find the attached screen shot for your reference and sample URL where you can see the cross domain issue in console log. 



Best regards,
Sunil Kumar


Another_Ad_RequestingGoogle_200_Success.png
GoogleRespose_Error_304.png

Vu Chau (IMA SDK Team)

unread,
Jan 6, 2016, 11:09:49 AM1/6/16
to Interactive Media Ads SDK, ima-sdk-a...@google.com, ima-sdk...@google.com, suni...@gmail.com
Hi Sunil,

Thanks for the follow-up details.  On the server side, you'll need to set the allow-origin header to a specific domain (i.e. imasdk.googleapis.comor set the credentials flag to false.  The reason it is failing is because a wildcard "*" is being used in the allow-origin header and the credentials flag is true.  Please make either one of the aforementioned changes and let us know if it rectifies the issue!

Vu Chau
IMA SDK Team

Sunil Kumar

unread,
Jan 6, 2016, 11:31:00 AM1/6/16
to Vu Chau (IMA SDK Team), ima-sdk...@google.com, ima...@googlegroups.com

Hi Vu Chau,

Thanks a lot for prompt response, I am accessing Google Ima sdk URL and I don't have any control of Google then how can I set allow origin header.

Request you to please advise where and how to set it. I have sent you both URL and it would be better if you review it and help us to solve this issue.

Best regards,
Sunil

Vu Chau (IMA SDK Team)

unread,
Jan 6, 2016, 2:20:34 PM1/6/16
to Interactive Media Ads SDK, ima-sdk-a...@google.com, ima-sdk...@google.com, suni...@gmail.com
Hi Sunil,

Sorry for the confusion.  So the issue turned out to be because of the wrapper.  The wrappers (https://ima3vpaid.appspot.com and https://imasdk.googleapis.com) here are VPAID adapters, and if you are using IMA already then you don't need the VPAID adapter.  Try testing the direct DFP-hosted tag (https://googleads.g.doubleclick.net/pagead/ads?client=ca-video-pub-8609501543919728&slotname=9922539035&ad_type=video&description_url=http%3A%2F%2Fwww.ndtv.com%2Fvideo%2Flive%2Fchannel%2Fndtv24x7&max_ad_duration=15000&sdmax=60000&videoad_start_delay=0) and let us know if the issue persists.  When you are generating tags on DFP's front end, make sure you are not using any option that'd add ima3vpaid.appspot.com to your tag.  Since you don't need the adapter in an IMA-enabled environment, there is no CORS header present on one of the pages.

Thanks,

Vu Chau
IMA SDK Team

Sunil Kumar

unread,
Jan 12, 2016, 1:57:36 AM1/12/16
to Vu Chau (IMA SDK Team), Interactive Media Ads SDK, ima-sdk...@google.com
Thanks a lot Vu Chau, 

After updating URL its working fine. 

Thanks a lot for your kind support :)

Best regards,
Sunil Kumar

Reply all
Reply to author
Forward
0 new messages