Solving the Safari ITP 2.0 Issue with PHP

Jason_Beacon
Shopify Partner
224 9 38

We're having issues with understanding the logic behind the remote redirection to the parent window after carefully reading the following documentation https://help.shopify.com/en/api/guides/itp-impact.and looking through the previous forum comments.

 

On the server-side using PHP, we set the session of the name of the store and we're able to get the session and it's working in browsers like Chrome or Firefox. Through Safari, the system is not storing any cookies and we are not able to load our application through the iframe inside the admin panel.

 

Is there anyone inside Shopify that can help us?

Decrease fraudulent orders, stop chargebacks with Beacon. The most customizable fraud and risk management system built for Shopify businesses

https://apps.shopify.com/beacon
Replies 7 (7)
SBD_
Shopify Staff
Shopify Staff
1098 146 219

Hey @Jason_Beacon,

 

Is your app detecting Safari 12+ users and following the flow set out in https://help.shopify.com/en/api/guides/itp-impact? These users will need to interact with your app while it's the parent window, and accept to receive cookies, before redirecting back to Shopify. At what point are you getting stuck? Would a bare bones example be helpful?

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Jason_Beacon
Shopify Partner
224 9 38

@SBD_ 

 

Actually we managed to finally fix this issue after having look through our redirection logic and setting up cookies outside of the iframe!

 

Consider this issue resolved.

 

 

Decrease fraudulent orders, stop chargebacks with Beacon. The most customizable fraud and risk management system built for Shopify businesses

https://apps.shopify.com/beacon
WebContrive
Shopify Expert
25 0 2

Hi @Jason_Beacon can you please let us know how you did manage to fix this issue ? Your help will be appreciate.

Jason_Beacon
Shopify Partner
224 9 38

Hi @WebContrive .

 

What do you need help with exactly? We fixed our problem by detecting Safari browsers and then tweaking our redirection logic and setting a new page and setting the cookie. 

 

Jason

 

Decrease fraudulent orders, stop chargebacks with Beacon. The most customizable fraud and risk management system built for Shopify businesses

https://apps.shopify.com/beacon
WebContrive
Shopify Expert
25 0 2

Hi @Jason_Beacon ,

 

I mean what type of redirection you set in your app for cookies special for Mac Safari ?

ankit_jasoliya
New Member
1 0 0

I Create Shopify App in PHP, It's working good in chrome, but it's not working in Safari And Firefox Browser,

I got this error
"Unrecognized Content-Security-Policy directive 'worker-src'."

"Refused to load https://lasy-international.myshopify.com/admin/auth/login because it does not appear in the frame-ancestors directive of the Content Security Policy."

Is there anyone who can help me solve this issue?

Please let me know what integration should i do?

sbdev
Shopify Partner
47 0 4

HI @ankit_jasoliya 

I am getting this same error currently, have you solved this?  My app is also in PHP and in safari, it is not redirecting in the Whitelisted redirect URI and getting the same error in console as you had.