Sign in oauth/authenticate not working


Hello! I’m trying without success, performing authentication of a user.
When all of the following steps:

	        /* Build TwitterOAuth object with client credentials. */
	        $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);

	        /* Get temporary credentials. */

	        $request_token = $connection->getRequestToken("XXXXXXXXXX");
	        $token = $request_token['oauth_token'];
	        /* Build authorize URL and redirect user to Twitter. */
	        $url = $connection->getAuthorizeURL($token);

The url is equivalent to:

but when accessing the url, and perform acceptance, makes a callback to

The app callback it’s set with the same web of $connection->getRequestToken(“XXXXXXXXXX”);

I’m going crazy from 2 days ago and should be easier, any help?