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

getAuthToken() always throws redirect_uri mismatch error #281

Open
nbennett25 opened this issue Oct 18, 2022 · 0 comments
Open

getAuthToken() always throws redirect_uri mismatch error #281

nbennett25 opened this issue Oct 18, 2022 · 0 comments

Comments

@nbennett25
Copy link

Expected behavior

App is installed

Actual behavior

Parameter redirect_uri does not match registered URI error thrown, app is not installed.

Steps to reproduce behavior

Using bigcommerce/api version 3.3.1. When using the README.md instructions to get the App's auth token, the "Parameter redirect_uri does not match registered URI" error is always thrown.

I've tried using trailing slashes and not, changing apps, etc. but when I add the Loadcallback URI from the App to the redirect_uri parameter in the code below, sending the request to getAuthToken() always fails.

use Bigcommerce\Api\Client as Bigcommerce;

$object = new \stdClass();
$object->client_id = '[client id from test app]';
$object->client_secret = '[client secret from test app]';
$object->redirect_uri = '[copy pasted from Load Callback URL]';
$object->code = $request->get('code');
$object->context = $request->get('context');
$object->scope = $request->get('scope');

$authTokenResponse = Bigcommerce::getAuthToken($object);

// fails here - getAuthToken returns false

Bigcommerce::configure(array(
    'client_id' => 'xxxxxxxx',
    'auth_token' => $authTokenResponse->access_token,
    'store_hash' => 'xxxxxxx'
));
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

1 participant