public static function authorize($code)
    {
        // configuration
        $config = self::config();

        // no configuration file
        if (!$config) {
            return false;
        }

        $url = self::$clef_base_url."authorize";

        $postdata = http_build_query(array(
            'code'       => $code,
            'app_id'     => $config['app_id'],
            'app_secret' => $config['app_secret']
        ));

        $opts = array('http' => array(
            'method'  => 'POST',
            'header'  => 'Content-type: application/x-www-form-urlencoded',
            'content' => $postdata
        ));

        // get oauth code for the handshake
        $context  = stream_context_create($opts);
        $response = file_get_contents($url, false, $context);

        if ($response) {
            $response = json_decode($response, true);

            return $response;
        }

        return false;
    }