Closed simplenotezy closed 8 years ago
I created a method, that enable the user to assign the access_token manually. Any chance you could pull this one in?
/**
* set access token
*/
public function setAccessToken($token) {
/**
* Data
*/
$data = array(
'access_token' => $token
);
/**
* Prepare token
*/
$token = new StdOAuth2Token();
$token->setAccessToken($data['access_token']);
/**
* Params
*/
$token->setExtraParams($data);
/**
* Set code
*/
$this->storage->storeAccessToken($this->service(), $token);
}
You dont need any additional function to set the access token, the correct way to do this is,
use OAuth\OAuth2\Token\StdOAuth2Token;
$token_interface = new StdOAuth2Token($token);
$fb = OAuth::consumer( 'Facebook' );
$token = $fb->getStorage()->storeAccessToken('Facebook', $token_interface);
@mohamedfasil thank you for answer!
How can I manually set the access token? I.e.: