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);
    }