skip to Main Content

I’m trying to intergrate with Xero via their API SDK (https://github.com/XeroAPI/xero-php-oauth2)

I have installed via composer and am using Codignitor 3 for the framework.

I keep getting this error:

An uncaught Exception was encountered
Type: LeagueOAuth2ClientProviderExceptionIdentityProviderException
Message: invalid_client

Filename: /var/www/vhosts/xxxx.co.uk/vendor/league/oauth2-client/src/Provider/GenericProvider.php
Line Number: 236

Backtrace:

File: /var/www/vhosts/xxxx.co.uk/vendor/league/oauth2-client/src/Provider/AbstractProvider.php
Line: 733

Function: checkResponse 

File: /var/www/vhosts/xxxx.co.uk/vendor/league/oauth2-client/src/Provider/AbstractProvider.php
Line: 636

Function: getParsedResponse 

File: /var/www/vhosts/xxxx.co.uk/application/controllers/Pages.php

Line: 42

Function: getAccessToken 

File: /var/www/vhosts/xxxx.co.uk/index.php
Line: 319
Function: require_once

I know the Client is correct but I’m really struggling to work out how to fault find this error.

Has anyone had the same issues? I’ve Googled but not found a solution as yet?

2

Answers


  1. Chosen as BEST ANSWER

    I've reset the client secret which seems to have worked. I'm not sure why the previous didn't work but seems OK now.


  2. If you receive an Invalid Client Error, either the Client ID or the Client Secret being sent through during authorisation is Incorrect or Invalid.

    If your Client ID is correct, please check that the Base 64 Encoded Authorisation Header is also correct and contains a : (colon) between the ID and Secret when you’re encoding. As a final step, I’d also suggest generating a new Client Secret and replacing the old secret with this new secret, wherever required.

    For more information, please see the link below.

    Xero Developer Centre: Troubleshooting

    If this does not resolve the issue, please can you raise a case with Xero Support here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search