File tree 2 files changed +16
-2
lines changed 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -82,12 +82,27 @@ Bigcommerce::configure(array(
82
82
~~~
83
83
84
84
### OAuth
85
+
86
+ In order to obtain the auth_token you would consume ` Bigcommerce::getAuthToken ` method
87
+
85
88
~~~ php
89
+
90
+ $object = new \stdClass();
91
+ $object->client_id = 'xxxxxx';
92
+ $object->client_secret = 'xxxxx;
93
+ $object->redirect_uri = 'https://app.com/redirect';
94
+ $object->code = $request->get('code');
95
+ $object->context = $request->get('context');
96
+ $object->scope = $request->get('scope');
97
+
98
+ $authTokenResponse = Bigcommerce::getAuthToken($object);
99
+
86
100
Bigcommerce::configure(array(
87
101
'client_id' => 'xxxxxxxx',
88
- 'auth_token' => 'xxxxxxx' ,
102
+ 'auth_token' => $authTokenResponse->access_token ,
89
103
'store_hash' => 'xxxxxxx'
90
104
));
105
+
91
106
~~~
92
107
93
108
Connecting to the store
Original file line number Diff line number Diff line change @@ -413,7 +413,6 @@ public static function getAuthToken($object)
413
413
{
414
414
$ context = array_merge (array ('grant_type ' => 'authorization_code ' ), (array )$ object );
415
415
$ connection = new Connection ();
416
- $ connection ->useUrlEncoded ();
417
416
418
417
return $ connection ->post (self ::$ login_url . '/oauth2/token ' , $ context );
419
418
}
You can’t perform that action at this time.
0 commit comments