简体   繁体   中英

Shopify API using PHP, redirect_uri and app url must have matching hosts of myshopify.com?

I'm trying to use the php shopify api library created by cmcdonaldca at https://github.com/cmcdonaldca/ohShopify.php and

I am getting this error:

The redirect_uri and application url must have matching hosts

This occurs after I type in the shop name of [myshopname].myshopify.com and the error appears on a page with this url: https://[myshopname].myshopify.com/admin/oauth/authorize?client_id=[myclientid]&scope=Customer&redirect_uri=http%3A%2F%2Flocalhost%2Ftest%2FshopifyAPITest2.php

I'm doing this development locally so my host is localhost, is that really the issue? The first time I tried entering a shop name I got to the shopify page asking me to login, but then when I tried it again later it is giving me the error. Is there some session variable that was set initially that is causing the error? It doesn't look like it based on the error, but that's what the behavior suggests.

Please help me understand how to address this issue. If it really means the api script needs to be hosted at myshopify.com (the host for [myshopname].myshopify.com) how would I put a php script there?

Thank you

The error you're receiving is telling you that the domain of the application URL you entered for the app in the Partners dashboard differs from the one you're providing with your OAuth request.

Make sure it's listed as localhost and the error should go away.

应用偏好截图

此外,请确保在config / application.rb中正确设置了API密钥和共享密钥

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM