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

Obtaining Invalid Client error. #577

Open
MarkLFT opened this issue Nov 22, 2024 · 3 comments
Open

Obtaining Invalid Client error. #577

MarkLFT opened this issue Nov 22, 2024 · 3 comments

Comments

@MarkLFT
Copy link

MarkLFT commented Nov 22, 2024

SDK you're using (please complete the following information):

  • Version 9.2

Describe the bug
With no change in my code, all tests relating to communicating with the account API fail with an invalid client error. I have confirmed the client ID is correct. I have tried an existing known good secret and a newly generated secret. Still the same.

The error is thrown in the RequestClientCredentialsTokenAsync() method call.

To Reproduce

var token = await _currentState.GetJwtToken();

if (token == null || token.ExpiresAtUtc <= DateTime.UtcNow.AddMinutes(5))
{
    XeroConfiguration xeroConfig = new()
    {
        ClientId = _options.Current.ClientId,
        ClientSecret = _options.Current.ClientSecret
    };
    var client = new XeroClient(xeroConfig);

    IXeroToken xeroToken = await client.RequestClientCredentialsTokenAsync();
    await _currentState.SetJwtToken(new JwtToken(xeroToken.AccessToken, xeroToken.RefreshToken, xeroToken.ExpiresAtUtc));
}

This is the code I use to obtain a token, code that has worked fine for months but now fails with an invalid client.

Expected behavior
A new access token to be issued to allow further interaction with the API.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Copy link

PETOSS-673

Copy link

Thanks for raising an issue, a ticket has been created to track your request

@Sallyhornet
Copy link

Please can you raise a case with Xero Support here and let us know the client id and the time, date and timezone for the most recent error so we can check whether or not this is related to the SDK itself or the API

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