lib/opauth/Strategy/Twitter/TwitterStrategy.php
public function oauth_callback() {
		if (!session_id()) {
			session_start();
		}
		$session = $_SESSION['_opauth_twitter'];
		unset($_SESSION['_opauth_twitter']);

		if (!empty($_REQUEST['oauth_token']) && $_REQUEST['oauth_token'] == $session['oauth_token']) {
			$this->tmhOAuth->config['user_token'] = $session['oauth_token'];
			$this->tmhOAuth->config['user_secret'] = $session['oauth_token_secret'];
			
			$params = array(
				'oauth_verifier' => $_REQUEST['oauth_verifier']
			);
		
			$results =  $this->_request('POST', $this->strategy['access_token_url'], $params);

			if ($results !== false && !empty($results['oauth_token']) && !empty($results['oauth_token_secret'])) {
				$credentials = $this->_verify_credentials($results['oauth_token'], $results['oauth_token_secret']);
				
				if (!empty($credentials['id'])) {
					
					$this->auth = array(
						'uid' => $credentials['id'],
						'info' => array(
							'name' => $credentials['name'],
							'nickname' => $credentials['screen_name'],
							'urls' => array(
								'twitter' => str_replace('{screen_name}', $credentials['screen_name'], $this->strategy['twitter_profile_url'])
							)
						),
						'credentials' => array(
							'token' => $results['oauth_token'],
							'secret' => $results['oauth_token_secret']
						),
						'raw' => $credentials
					);
					
					$this->mapProfile($credentials, 'location', 'info.location');
					$this->mapProfile($credentials, 'description', 'info.description');
					$this->mapProfile($credentials, 'profile_image_url_https', 'info.image');
					$this->mapProfile($credentials, 'url', 'info.urls.website');
					$this->mapProfile($credentials, 'email', 'info.email');
					
					$this->callback();
				}
			}
		} else {
			$error = array(
				'code' => 'access_denied',
				'message' => 'User denied access.',
				'raw' => $_GET
			);

			$this->errorCallback($error);
		}
		
				
	}
public function oauth_callback() {
		if (!session_id()) {
			session_start();
		}
		$session = $_SESSION['_opauth_twitter'];
		unset($_SESSION['_opauth_twitter']);

		if (!empty($_REQUEST['oauth_token']) && $_REQUEST['oauth_token'] == $session['oauth_token']) {
			$this->tmhOAuth->config['user_token'] = $session['oauth_token'];
			$this->tmhOAuth->config['user_secret'] = $session['oauth_token_secret'];
			
			$params = array(
				'oauth_verifier' => $_REQUEST['oauth_verifier']
			);
		
			$results =  $this->_request('POST', $this->strategy['access_token_url'], $params);

			if ($results !== false && !empty($results['oauth_token']) && !empty($results['oauth_token_secret'])) {
				$credentials = $this->_verify_credentials($results['oauth_token'], $results['oauth_token_secret']);
				
				if (!empty($credentials['id'])) {
					
					$this->auth = array(
						'uid' => $credentials['id'],
						'info' => array(
							'name' => $credentials['name'],
							'nickname' => $credentials['screen_name'],
							'urls' => array(
								'twitter' => str_replace('{screen_name}', $credentials['screen_name'], $this->strategy['twitter_profile_url'])
							)
						),
						'credentials' => array(
							'token' => $results['oauth_token'],
							'secret' => $results['oauth_token_secret']
						),
						'raw' => $credentials
					);
					
					$this->mapProfile($credentials, 'location', 'info.location');
					$this->mapProfile($credentials, 'description', 'info.description');
					$this->mapProfile($credentials, 'profile_image_url_https', 'info.image');
					$this->mapProfile($credentials, 'url', 'info.urls.website');
					$this->mapProfile($credentials, 'email', 'info.email');
					
					$this->callback();
				}
			}
		} else {
			$error = array(
				'code' => 'access_denied',
				'message' => 'User denied access.',
				'raw' => $_GET
			);

			$this->errorCallback($error);
		}
		
				
	}
public function oauth_callback ( ) { if ( ! session_id ( ) ) { session_start ( ) ; } $ session = $ _SESSION [ '_opauth_twitter' ] ; unset ( $ _SESSION [ '_opauth_twitter' ] ) ; if ( ! empty ( $ _REQUEST [ 'oauth_token' ] ) && $ _REQUEST [ 'oauth_token' ] == $ session [ 'oauth_token' ] ) { $ this -> tmhOAuth -> config [ 'user_token' ] = $ session [ 'oauth_token' ] ; $ this -> tmhOAuth -> config [ 'user_secret' ] = $ session [ 'oauth_token_secret' ] ; $ params = array ( 'oauth_verifier' => $ _REQUEST [ 'oauth_verifier' ] ) ; $ results = $ this -> _request ( 'POST' , $ this -> strategy [ 'access_token_url' ] , $ params ) ; if ( $ results !== false && ! empty ( $ results [ 'oauth_token' ] ) && ! empty ( $ results [ 'oauth_token_secret' ] ) ) { $ credentials = $ this -> _verify_credentials ( $ results [ 'oauth_token' ] , $ results [ 'oauth_token_secret' ] ) ; if ( ! empty ( $ credentials [ 'id' ] ) ) { $ this -> auth = array ( 'uid' => $ credentials [ 'id' ] , 'info' => array ( 'name' => $ credentials [ 'name' ] , 'nickname' => $ credentials [ 'screen_name' ] , 'urls' => array ( 'twitter' => str_replace ( '{screen_name}' , $ credentials [ 'screen_name' ] , $ this -> strategy [ 'twitter_profile_url' ] ) ) ) , 'credentials' => array ( 'token' => $ results [ 'oauth_token' ] , 'secret' => $ results [ 'oauth_token_secret' ] ) , 'raw' => $ credentials ) ; $ this -> mapProfile ( $ credentials , 'location' , 'info.location' ) ; $ this -> mapProfile ( $ credentials , 'description' , 'info.description' ) ; $ this -> mapProfile ( $ credentials , 'profile_image_url_https' , 'info.image' ) ; $ this -> mapProfile ( $ credentials , 'url' , 'info.urls.website' ) ; $ this -> mapProfile ( $ credentials , 'email' , 'info.email' ) ; $ this -> callback ( ) ; } } } else { $ error = array ( 'code' => 'access_denied' , 'message' => 'User denied access.' , 'raw' => $ _GET ) ; $ this -> errorCallback ( $ error ) ; } }
Receives oauth_verifier, requests for access_token and redirect to callback
Receives oauth_verifier requests for access_token and redirect to callback