public function token()
    {
        // Handle the token request
        $response = $this->tokenServer->handleTokenRequest(\OAuth2\Request::createFromGlobals());

        // Get the data as json and convert it to an array,
        // - so we can set our own response type.
        $data = $response->getResponseBody('json');
        $data = json_decode($data, true);

        // Set the response, status code and output content setting final output to true
        $this->response = $data;
        $this->statusCode = $response->getStatusCode();
        $this->output(true);
        return $this;
    }
public function token()
    {
        // Handle the token request
        $response = $this->tokenServer->handleTokenRequest(\OAuth2\Request::createFromGlobals());

        // Get the data as json and convert it to an array,
        // - so we can set our own response type.
        $data = $response->getResponseBody('json');
        $data = json_decode($data, true);

        // Set the response, status code and output content setting final output to true
        $this->response = $data;
        $this->statusCode = $response->getStatusCode();
        $this->output(true);
        return $this;
    }
public function token ( ) { // Handle the token request $ response = $ this -> tokenServer -> handleTokenRequest ( \ OAuth2 \ Request :: createFromGlobals ( ) ) ; // Get the data as json and convert it to an array, // - so we can set our own response type. $ data = $ response -> getResponseBody ( 'json' ) ; $ data = json_decode ( $ data , true ) ; // Set the response, status code and output content setting final output to true $ this -> response = $ data ; $ this -> statusCode = $ response -> getStatusCode ( ) ; $ this -> output ( true ) ; return $ this ; }
Handles generating tokens for clients.

@return $this The current object.
Handles generating tokens for clients .