TijsVerkoyen\Twitter\Twitter::oAuthAuthenticate PHP Method

oAuthAuthenticate() public method

This method is a replacement fulfills Secion 6.2 of the OAuth 1.0 authentication flow for applications using the Sign in with Twitter authentication flow. The method will use the currently logged in user as the account to for access authorization unless the force_login parameter is set to true
public oAuthAuthenticate ( string $token, bool[optional] $force = false, string[optional] $screen_name = false )
$token string The token.
$force bool[optional]
$screen_name string[optional]
    public function oAuthAuthenticate($token, $force = false, $screen_name = false)
    {
        $url = self::SECURE_API_URL . '/oauth/authenticate?oauth_token=' . $token;
        if ($force) {
            $url .= '&force_login=true';
        }
        if ($screen_name) {
            $url .= '&screen_name=' . $screen_name;
        }
        header('Location: ' . $url);
    }
Twitter