/** * @inheritdoc */ public function fetchAccessToken(OAuthToken $requestToken = null, $oauthVerifier = null, array $params = []) { $this->removeState('requestToken'); $tokenConfig = ['class' => OAuthToken::className(), 'params' => ['oauth_token' => $this->token, 'oauth_token_secret' => $this->tokenSecret]]; $token = Yii::createObject($tokenConfig); $this->setAccessToken($token); return $token; }
/** * Creates token from its configuration. * @param array $tokenConfig token configuration. * @return OAuthToken token instance. */ protected function createToken(array $tokenConfig = []) { if (!array_key_exists('class', $tokenConfig)) { $tokenConfig['class'] = OAuthToken::className(); } return Yii::createObject($tokenConfig); }