protected function createNewTokens()
    {
        $logger = $this->getLogger();
        $logger->debug('Starting request to create fresh access & refresh tokens');

        $body = [
            'client_id' => 'anonymous',
            'grant_type' => 'password',
            'response_type' => 'token',
            'scope' => 'openid',
            'username' => $this->credentials->getUsername(),
            'password' => $this->credentials->getPassword(),
        ];

        $response = $this->sendPostRequest($body);

        $logger->debug('Successfully retrieved new access & refresh tokens', $response);

        return [
            'accessToken' => new Token(
                $response['access_token'],
                $this->tokenExtractor->extract($response['access_token'])
            ),
            'refreshToken' => new Token(
                $response['refresh_token'],
                $this->tokenExtractor->extract($response['refresh_token'])
            ),
        ];
    }
protected function createNewTokens()
    {
        $logger = $this->getLogger();
        $logger->debug('Starting request to create fresh access & refresh tokens');

        $body = [
            'client_id' => 'anonymous',
            'grant_type' => 'password',
            'response_type' => 'token',
            'scope' => 'openid',
            'username' => $this->credentials->getUsername(),
            'password' => $this->credentials->getPassword(),
        ];

        $response = $this->sendPostRequest($body);

        $logger->debug('Successfully retrieved new access & refresh tokens', $response);

        return [
            'accessToken' => new Token(
                $response['access_token'],
                $this->tokenExtractor->extract($response['access_token'])
            ),
            'refreshToken' => new Token(
                $response['refresh_token'],
                $this->tokenExtractor->extract($response['refresh_token'])
            ),
        ];
    }
protected function createNewTokens ( ) { $ logger = $ this -> getLogger ( ) ; $ logger -> debug ( 'Starting request to create fresh access & refresh tokens' ) ; $ body = [ 'client_id' => 'anonymous' , 'grant_type' => 'password' , 'response_type' => 'token' , 'scope' => 'openid' , 'username' => $ this -> credentials -> getUsername ( ) , 'password' => $ this -> credentials -> getPassword ( ) , ] ; $ response = $ this -> sendPostRequest ( $ body ) ; $ logger -> debug ( 'Successfully retrieved new access & refresh tokens' , $ response ) ; return [ 'accessToken' => new Token ( $ response [ 'access_token' ] , $ this -> tokenExtractor -> extract ( $ response [ 'access_token' ] ) ) , 'refreshToken' => new Token ( $ response [ 'refresh_token' ] , $ this -> tokenExtractor -> extract ( $ response [ 'refresh_token' ] ) ) , ] ; }
Create completely fresh Access + Refresh tokens.

@TODO Implement proper error handling

@return array
Create completely fresh Access + Refresh tokens .