xero-php
xero-php copied to clipboard
Gateway Time-out - getAccessToken
I regularly receive timeouts from Xero when getting an access token, but can't see how to extend the timeout period - old issues mention a config file, but that doesn't seem to exist any now?
Calcinai\OAuth2\Client\Provider\Exception\XeroProviderException
Gateway Time-out
$accessToken = $provider->getAccessToken('client_credentials', [
'scope' => $scope,
]);
Around the same time as the above, I also receive the following;
GuzzleHttp \ Exception \ ConnectException
cURL error 35: OpenSSL SSL_connect: Connection reset by peer in connection to identity.xero.com:443 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://identity.xero.com/connect/token
This may or may not help, but have you looked at the constructor of the AbstractProvider? You should be able to pass timeout as an option in there.
Thank you. I've taken a look, but not quite sure how to pass through a new timeout value.
By the looks, it's as simple as adding a timeout
key to the constructor of the OAuth provider
Would you mind providing an example on how to do that with calcinai/xero-php please?
Hi @olimortimer it’s not actually part of this library. The link I posted above was to the league/oauth2 library, which is extended and used here. I’m 100% sure on the suggestion, as it was based on skimming the code in that library.
I’d recommend taking a proper look there to see which options/config is allowed to be passed in.