private function getAccessTokenFromAuthorizationCode($code) {
    if ($this->getVariable('access_token_uri') && $this->getVariable('client_id') && $this->getVariable('client_secret')) {
      return json_decode($this->makeRequest(
        $this->getVariable('access_token_uri'),
        'POST',
        array(
          'grant_type' => 'authorization_code',
          'client_id' => $this->getVariable('client_id'),
          'client_secret' => $this->getVariable('client_secret'),
          'code' => $code,
          'redirect_uri' => $this->getCurrentUri(),
        )
      ), TRUE);
    }
    return NULL;
  }
private function getAccessTokenFromAuthorizationCode($code) {
    if ($this->getVariable('access_token_uri') && $this->getVariable('client_id') && $this->getVariable('client_secret')) {
      return json_decode($this->makeRequest(
        $this->getVariable('access_token_uri'),
        'POST',
        array(
          'grant_type' => 'authorization_code',
          'client_id' => $this->getVariable('client_id'),
          'client_secret' => $this->getVariable('client_secret'),
          'code' => $code,
          'redirect_uri' => $this->getCurrentUri(),
        )
      ), TRUE);
    }
    return NULL;
  }
private function getAccessTokenFromAuthorizationCode ( $ code ) { if ( $ this -> getVariable ( 'access_token_uri' ) && $ this -> getVariable ( 'client_id' ) && $ this -> getVariable ( 'client_secret' ) ) { return json_decode ( $ this -> makeRequest ( $ this -> getVariable ( 'access_token_uri' ) , 'POST' , array ( 'grant_type' => 'authorization_code' , 'client_id' => $ this -> getVariable ( 'client_id' ) , 'client_secret' => $ this -> getVariable ( 'client_secret' ) , 'code' => $ code , 'redirect_uri' => $ this -> getCurrentUri ( ) , ) ) , TRUE ) ; } return NULL ; }
Get access token from OAuth2.0 token endpoint with authorization code.

This function will only be activated if both access token URI, client
identifier and client secret are setup correctly.

@param $code
Authorization code issued by authorization server's authorization
endpoint.

@return
A valid OAuth2.0 JSON decoded access token in associative array, and
NULL if not enough parameters or JSON decode failed.
Get access token from OAuth2 . 0 token endpoint with authorization code .