I’m using Abraham Williams’ Twitter OAuth class and it seems to work about 20% of the time and the rest of the time I get the following message:
“Invalid oauth_verifier parameter”
The snippet of code where this is happening is:
$access_token = new TwitterOAuth( $client_id, $client_secret, $_SESSION['request_token'], $_SESSION['request_token_secret'] );
$access_token = $access_token->getAccessToken( $_GET['oauth_verifier'] );
if ( ! isset( $access_token['user_id'] ) ) {
$connection = new TwitterOAuth( $client_id, $client_secret, $access_token['oauth_token'], $access_token['oauth_token_secret'] );
$params = array(
'include_entities' => 'false',
);
$user_data = $connection->get( 'account/verify_credentials' );
} else {
$user_data = new stdclass;
$user_data->id = $access_token['user_id'];
$user_data->screen_name = $access_token['screen_name'];
$user_data->name = $access_token['screen_name'];
}
Has anyone else run into this issue and is there a fix?