Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gateway Time-out - getAccessToken #908

Open
olimortimer opened this issue Dec 20, 2023 · 5 comments
Open

Gateway Time-out - getAccessToken #908

olimortimer opened this issue Dec 20, 2023 · 5 comments

Comments

@olimortimer
Copy link
Contributor

olimortimer commented Dec 20, 2023

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
@calcinai
Copy link
Owner

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.

@olimortimer
Copy link
Contributor Author

Thank you. I've taken a look, but not quite sure how to pass through a new timeout value.

@calcinai
Copy link
Owner

calcinai commented Jan 3, 2024

By the looks, it's as simple as adding a timeout key to the constructor of the OAuth provider

@olimortimer
Copy link
Contributor Author

Would you mind providing an example on how to do that with calcinai/xero-php please?

@calcinai
Copy link
Owner

calcinai commented Jan 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants