I use the following code to get the bearer token:
$token = base64_encode($client_id.\':\'.$client_sec);
$data = array (\'grant_type\' => \'client_credent
After fighting with this problem for a while I found the problem was I was making the call to /oauth2/token using Advanced Rest Client from a browser I was already logged into Twitter with. After logging out of Twitter and making the API call again it worked fine.
Short answer: make sure you do not already have an active session logged into Twitter when attempting to request a Bearer token.