public function fetchRequestToken(array $params = [])
    {
        $this->setAccessToken(null);
        $defaultParams = [
            'oauth_consumer_key' => $this->consumerKey,
            'oauth_callback' => $this->getReturnUrl(),
            //'xoauth_displayname' => Yii::$app->name,
        ];
        if (!empty($this->scope)) {
            $defaultParams['scope'] = $this->scope;
        }

        $request = $this->createRequest()
            ->setMethod($this->requestTokenMethod)
            ->setUrl($this->requestTokenUrl)
            ->setData(array_merge($defaultParams, $params));

        $this->signRequest($request);

        $response = $this->sendRequest($request);

        $token = $this->createToken([
            'params' => $response
        ]);
        $this->setState('requestToken', $token);

        return $token;
    }
public function fetchRequestToken(array $params = [])
    {
        $this->setAccessToken(null);
        $defaultParams = [
            'oauth_consumer_key' => $this->consumerKey,
            'oauth_callback' => $this->getReturnUrl(),
            //'xoauth_displayname' => Yii::$app->name,
        ];
        if (!empty($this->scope)) {
            $defaultParams['scope'] = $this->scope;
        }

        $request = $this->createRequest()
            ->setMethod($this->requestTokenMethod)
            ->setUrl($this->requestTokenUrl)
            ->setData(array_merge($defaultParams, $params));

        $this->signRequest($request);

        $response = $this->sendRequest($request);

        $token = $this->createToken([
            'params' => $response
        ]);
        $this->setState('requestToken', $token);

        return $token;
    }
public function fetchRequestToken ( array $ params = [ ] ) { $ this -> setAccessToken ( null ) ; $ defaultParams = [ 'oauth_consumer_key' => $ this -> consumerKey , 'oauth_callback' => $ this -> getReturnUrl ( ) , //'xoauth_displayname' => Yii::$app->name, ] ; if ( ! empty ( $ this -> scope ) ) { $ defaultParams [ 'scope' ] = $ this -> scope ; } $ request = $ this -> createRequest ( ) -> setMethod ( $ this -> requestTokenMethod ) -> setUrl ( $ this -> requestTokenUrl ) -> setData ( array_merge ( $ defaultParams , $ params ) ) ; $ this -> signRequest ( $ request ) ; $ response = $ this -> sendRequest ( $ request ) ; $ token = $ this -> createToken ( [ 'params' => $ response ] ) ; $ this -> setState ( 'requestToken' , $ token ) ; return $ token ; }
Fetches the OAuth request token.
@param array $params additional request params.
@return OAuthToken request token.
Fetches the OAuth request token .