lib/opauth/Strategy/Facebook/FacebookStrategy.php
public function int_callback(){
		if (empty($_GET['code'])) {
			$error = array(
				'provider' => 'Facebook',
				'code' => $_GET['error_code'],
				'message' => isset($_GET['error_message']) ? $_GET['error_message'] : '',
				'raw' => $_GET
			);

			$this->errorCallback($error);
			return;
		}

		$url = 'https://graph.facebook.com/oauth/access_token';
		$params = array(
			'client_id' =>$this->strategy['app_id'],
			'client_secret' => $this->strategy['app_secret'],
			'redirect_uri'=> $this->strategy['redirect_uri'],
			'code' => trim($_GET['code'])
		);
		$response = $this->serverGet($url, $params, null, $headers);
		$results = json_decode($response);

		if (empty($results) || empty($results->access_token)) {
			$error = array(
				'provider' => 'Facebook',
				'code' => 'access_token_error',
				'message' => 'Failed when attempting to obtain access token',
				'raw' => $headers
			);

			$this->errorCallback($error);
			return;
		}

		$me = $this->me($results->access_token);
		$this->auth = array(
			'provider' => 'Facebook',
			'uid' => $me->id,
			'info' => array(
				'name' => $me->name,
				'image' => "https://graph.facebook.com/{$this->api_version}/{$me->id}/picture?type=large"
			),
			'credentials' => array(
				'token' => $results->access_token,
				'expires' => date('c', time() + $results->expires_in)
			),
			'raw' => $me
		);

		if (!empty($me->email)) $this->auth['info']['email'] = $me->email;
		if (!empty($me->name)) $this->auth['info']['nickname'] = $me->name;
		if (!empty($me->first_name)) $this->auth['info']['first_name'] = $me->first_name;
		if (!empty($me->last_name)) $this->auth['info']['last_name'] = $me->last_name;
		if (!empty($me->link)) $this->auth['info']['urls']['facebook'] = $me->link;

		/**
		 * Missing optional info values
		 * - description
		 * - phone: not accessible via Facebook Graph API
		 */
		$this->callback();
	}
public function int_callback(){
		if (empty($_GET['code'])) {
			$error = array(
				'provider' => 'Facebook',
				'code' => $_GET['error_code'],
				'message' => isset($_GET['error_message']) ? $_GET['error_message'] : '',
				'raw' => $_GET
			);

			$this->errorCallback($error);
			return;
		}

		$url = 'https://graph.facebook.com/oauth/access_token';
		$params = array(
			'client_id' =>$this->strategy['app_id'],
			'client_secret' => $this->strategy['app_secret'],
			'redirect_uri'=> $this->strategy['redirect_uri'],
			'code' => trim($_GET['code'])
		);
		$response = $this->serverGet($url, $params, null, $headers);
		$results = json_decode($response);

		if (empty($results) || empty($results->access_token)) {
			$error = array(
				'provider' => 'Facebook',
				'code' => 'access_token_error',
				'message' => 'Failed when attempting to obtain access token',
				'raw' => $headers
			);

			$this->errorCallback($error);
			return;
		}

		$me = $this->me($results->access_token);
		$this->auth = array(
			'provider' => 'Facebook',
			'uid' => $me->id,
			'info' => array(
				'name' => $me->name,
				'image' => "https://graph.facebook.com/{$this->api_version}/{$me->id}/picture?type=large"
			),
			'credentials' => array(
				'token' => $results->access_token,
				'expires' => date('c', time() + $results->expires_in)
			),
			'raw' => $me
		);

		if (!empty($me->email)) $this->auth['info']['email'] = $me->email;
		if (!empty($me->name)) $this->auth['info']['nickname'] = $me->name;
		if (!empty($me->first_name)) $this->auth['info']['first_name'] = $me->first_name;
		if (!empty($me->last_name)) $this->auth['info']['last_name'] = $me->last_name;
		if (!empty($me->link)) $this->auth['info']['urls']['facebook'] = $me->link;

		/**
		 * Missing optional info values
		 * - description
		 * - phone: not accessible via Facebook Graph API
		 */
		$this->callback();
	}
public function int_callback ( ) { if ( empty ( $ _GET [ 'code' ] ) ) { $ error = array ( 'provider' => 'Facebook' , 'code' => $ _GET [ 'error_code' ] , 'message' => isset ( $ _GET [ 'error_message' ] ) ? $ _GET [ 'error_message' ] : '' , 'raw' => $ _GET ) ; $ this -> errorCallback ( $ error ) ; return ; } $ url = 'https://graph.facebook.com/oauth/access_token' ; $ params = array ( 'client_id' => $ this -> strategy [ 'app_id' ] , 'client_secret' => $ this -> strategy [ 'app_secret' ] , 'redirect_uri' => $ this -> strategy [ 'redirect_uri' ] , 'code' => trim ( $ _GET [ 'code' ] ) ) ; $ response = $ this -> serverGet ( $ url , $ params , null , $ headers ) ; $ results = json_decode ( $ response ) ; if ( empty ( $ results ) || empty ( $ results -> access_token ) ) { $ error = array ( 'provider' => 'Facebook' , 'code' => 'access_token_error' , 'message' => 'Failed when attempting to obtain access token' , 'raw' => $ headers ) ; $ this -> errorCallback ( $ error ) ; return ; } $ me = $ this -> me ( $ results -> access_token ) ; $ this -> auth = array ( 'provider' => 'Facebook' , 'uid' => $ me -> id , 'info' => array ( 'name' => $ me -> name , 'image' => "https://graph.facebook.com/{$this->api_version}/{$me->id}/picture?type=large" ) , 'credentials' => array ( 'token' => $ results -> access_token , 'expires' => date ( 'c' , time ( ) + $ results -> expires_in ) ) , 'raw' => $ me ) ; if ( ! empty ( $ me -> email ) ) $ this -> auth [ 'info' ] [ 'email' ] = $ me -> email ; if ( ! empty ( $ me -> name ) ) $ this -> auth [ 'info' ] [ 'nickname' ] = $ me -> name ; if ( ! empty ( $ me -> first_name ) ) $ this -> auth [ 'info' ] [ 'first_name' ] = $ me -> first_name ; if ( ! empty ( $ me -> last_name ) ) $ this -> auth [ 'info' ] [ 'last_name' ] = $ me -> last_name ; if ( ! empty ( $ me -> link ) ) $ this -> auth [ 'info' ] [ 'urls' ] [ 'facebook' ] = $ me -> link ; /**
		 * Missing optional info values
		 * - description
		 * - phone: not accessible via Facebook Graph API
		 */ $ this -> callback ( ) ; }
Internal callback, after Facebook's OAuth
Internal callback after Facebook s OAuth