yii\authclient\AuthAction::authOAuth1 PHP Method

authOAuth1() protected method

Performs OAuth1 auth flow.
protected authOAuth1 ( OAuth1 $client ) : Response
$client OAuth1 auth client instance.
return yii\web\Response action response.
    protected function authOAuth1($client)
    {
        // user denied error
        if (isset($_GET['denied'])) {
            return $this->redirectCancel();
        }
        if (isset($_REQUEST['oauth_token'])) {
            // Upgrade to access token.
            $client->fetchAccessToken($_REQUEST['oauth_token']);
            return $this->authSuccess($client);
        }
        // Get request token.
        $requestToken = $client->fetchRequestToken();
        // Get authorization URL.
        $url = $client->buildAuthUrl($requestToken);
        // Redirect to authorization URL.
        return Yii::$app->getResponse()->redirect($url);
    }