Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad Request in oauth #31

Open
tracysailors opened this issue May 23, 2017 · 6 comments
Open

Bad Request in oauth #31

tracysailors opened this issue May 23, 2017 · 6 comments

Comments

@tracysailors
Copy link

Hello, I'm receiving the following error in oauth.php. The install and app is working, but kicking back the following.

Any help is greatly appreciated! Thanks!

phpish\shopify\ApiException: [400] Bad Request (https://XXXXXXXX.myshopify.com/admin/oauth/access_token) in /nfs/c12/h04/mnt/220759/domains/XXXXXXXX/oauth.php on line 28 Array ( [method] => POST [uri] => https://XXXXXXXX.myshopify.com/admin/oauth/access_token [query] => Array ( ) [headers] => Array ( ) [payload] => Array ( [client_id] => XXXXX [client_secret] => XXXXX [code] => XXXXX ) )

@tracysailors tracysailors changed the title Oauth access_token Bad Request in oauth May 23, 2017
@myjanky
Copy link

myjanky commented May 23, 2017

Hi @tracysailors
When does the error happen? After install and when redirecting to the app nuts and bolts?

@tracysailors
Copy link
Author

Thanks for the reply! Yes, install works fine. The error occurs when reloading "oauth.php". I have my app URL set to point to "oauth.php", so anytime you load the app from Shopify.

@myjanky
Copy link

myjanky commented May 23, 2017

I see. You may have a redirect back to oauth.php then you can either store a permanent token exchanged for the temp one then do a header("location: ......") type of redirect to the nuts and bolts around line 31 of oauth.php. where the echo 'app installed successfully'

I use the ohshopify php lib due to this one having not been updated in awhile. You may have better luck with that. This one has an HMAC issue I think.

@tracysailors
Copy link
Author

tracysailors commented May 23, 2017

I changed to do a redirect with header() for now. Thanks!

@raviravikant
Copy link

Hi ,
I have set a redirect url in oauth.php link below:-
$publicappredirect_Url = 'http://payflic.flexsin.org/oauth.php';
if (!isset($_GET['code']))
{
$permission_url = shopify\authorization_url($_GET['shop'], SHOPIFY_APP_API_KEY, array('read_content', 'write_content', 'read_themes', 'write_themes', 'read_products', 'write_products', 'read_customers', 'write_customers', 'read_orders', 'write_orders', 'read_script_tags', 'write_script_tags', 'read_fulfillments', 'write_fulfillments', 'read_shipping', 'write_shipping'), $publicappredirect_Url);
die("<script> top.location.href='$permission_url'</script>");
}
and i have successfully installed the app in my development store , but when i click on my app it will redirect me on my site or give me an error like below ,
phpish\shopify\ApiException: [400] Bad Request (https://XXXXXXXX.myshopify.com/admin/oauth/access_token) in /nfs/c12/h04/mnt/220759/domains/XXXXXXXX/oauth.php on line 28 Array ( [method] => POST [uri] => https://XXXXXXXX.myshopify.com/admin/oauth/access_token [query] => Array ( ) [headers] => Array ( ) [payload] => Array ( [client_id] => XXXXX [client_secret] => XXXXX [code] => XXXXX ) )

can you guys please help me, I am new in shopify app development

@myjanky
Copy link

myjanky commented Dec 26, 2017

looks like there is no access token being passed. Any more details to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants