$me, 'client_id' => $client_id, 'scope' => $scope, ) ); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { //generate token $me = verifyUrlParameter($_POST, 'me'); $redirect_uri = verifyUrlParameter($_POST, 'redirect_uri'); $client_id = verifyUrlParameter($_POST, 'client_id'); $code = verifyParameter($_POST, 'code');//auth token $state = getOptionalParameter($_POST, 'state', null); //FIXME: check if code and state are set //FIXME: check auth endpoint if parameters are valid // and to get the scope $scope = 'post'; //FIXME: use real encryption $access_token = '

"\'' . json_encode( array( 'me' => $me, 'client_id' => $client_id, 'scope' => $scope ) ); header('HTTP/1.0 200 OK'); header('Content-type: application/x-www-form-urlencoded'); echo http_build_query( array( 'access_token' => $access_token, 'me' => $me, 'scope' => $scope ) ); } ?>