protected function authOAuth1($client, $authUrlParams = [])
    {
        $request = Yii::$app->getRequest();

        // user denied error
        if ($request->get('denied') !== null) {
            return $this->authCancel($client);
        }

        if (($oauthToken = $request->get('oauth_token', $request->post('oauth_token'))) !== null) {
            // Upgrade to access token.
            $client->fetchAccessToken($oauthToken);
            return $this->authSuccess($client);
        }

        // Get request token.
        $requestToken = $client->fetchRequestToken();
        // Get authorization URL.
        $url = $client->buildAuthUrl($requestToken, $authUrlParams);
        // Redirect to authorization URL.
        return Yii::$app->getResponse()->redirect($url);
    }
protected function authOAuth1($client, $authUrlParams = [])
    {
        $request = Yii::$app->getRequest();

        // user denied error
        if ($request->get('denied') !== null) {
            return $this->authCancel($client);
        }

        if (($oauthToken = $request->get('oauth_token', $request->post('oauth_token'))) !== null) {
            // Upgrade to access token.
            $client->fetchAccessToken($oauthToken);
            return $this->authSuccess($client);
        }

        // Get request token.
        $requestToken = $client->fetchRequestToken();
        // Get authorization URL.
        $url = $client->buildAuthUrl($requestToken, $authUrlParams);
        // Redirect to authorization URL.
        return Yii::$app->getResponse()->redirect($url);
    }
protected function authOAuth1 ( $ client , $ authUrlParams = [ ] ) { $ request = Yii :: $ app -> getRequest ( ) ; // user denied error if ( $ request -> get ( 'denied' ) !== null ) { return $ this -> authCancel ( $ client ) ; } if ( ( $ oauthToken = $ request -> get ( 'oauth_token' , $ request -> post ( 'oauth_token' ) ) ) !== null ) { // Upgrade to access token. $ client -> fetchAccessToken ( $ oauthToken ) ; return $ this -> authSuccess ( $ client ) ; } // Get request token. $ requestToken = $ client -> fetchRequestToken ( ) ; // Get authorization URL. $ url = $ client -> buildAuthUrl ( $ requestToken , $ authUrlParams ) ; // Redirect to authorization URL. return Yii :: $ app -> getResponse ( ) -> redirect ( $ url ) ; }
Performs OAuth1 auth flow.
@param OAuth1 $client auth client instance.
@param array $authUrlParams additional auth GET params.
@return Response action response.
Performs OAuth1 auth flow .