public function tokenAction(Request $request)
    {
        /** @var PropertyAccess $config */
        $config = $this->app['conf'];

        if ( ! $request->isSecure() && $config->get(['main', 'api_require_ssl'], true) == true) {
            throw new HttpException(400, 'This route requires the use of the https scheme: ' . $config->get(['main', 'api_require_ssl']), null, ['content-type' => 'application/json']);
        }

        $this->oAuth2Adapter->grantAccessToken();
        ob_flush();
        flush();

        // As OAuth2 library already outputs response content, we need to send an empty
        // response to avoid breaking silex controller
        return '';
    }
public function tokenAction(Request $request)
    {
        /** @var PropertyAccess $config */
        $config = $this->app['conf'];

        if ( ! $request->isSecure() && $config->get(['main', 'api_require_ssl'], true) == true) {
            throw new HttpException(400, 'This route requires the use of the https scheme: ' . $config->get(['main', 'api_require_ssl']), null, ['content-type' => 'application/json']);
        }

        $this->oAuth2Adapter->grantAccessToken();
        ob_flush();
        flush();

        // As OAuth2 library already outputs response content, we need to send an empty
        // response to avoid breaking silex controller
        return '';
    }
public function tokenAction ( Request $ request ) { /** @var PropertyAccess $config */ $ config = $ this -> app [ 'conf' ] ; if ( ! $ request -> isSecure ( ) && $ config -> get ( [ 'main' , 'api_require_ssl' ] , true ) == true ) { throw new HttpException ( 400 , 'This route requires the use of the https scheme: ' . $ config -> get ( [ 'main' , 'api_require_ssl' ] ) , null , [ 'content-type' => 'application/json' ] ) ; } $ this -> oAuth2Adapter -> grantAccessToken ( ) ; ob_flush ( ) ; flush ( ) ; // As OAuth2 library already outputs response content, we need to send an empty // response to avoid breaking silex controller return '' ; }
TOKEN ENDPOINT
Token endpoint - used to exchange an authorization grant for an access token.
@param Request $request
@return string
TOKEN ENDPOINT Token endpoint - used to exchange an authorization grant for an access token .