Hi,
For unknow reason im starting to get this error now:
"An error occurred refreshing the Xero access token. Reason: Parameter is required Parameter name: refresh_token"
Anyone else?
Code im using:
public XeroToken GetToken()
{
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
var xeroOAuth2Token = this.TokenStore.GetToken();
if (DateTime.UtcNow > xeroOAuth2Token.ExpiresAtUtc)
{
var client = new XeroClient(new XeroConfiguration
{
AppName = Settings.AppName,
ClientId = Settings.ClientId,
ClientSecret = Settings.ClientSecret,
Scope = Settings.Scopes
});
try
{
xeroOAuth2Token = (XeroOAuth2Token)client.RefreshAccessTokenAsync(xeroOAuth2Token).Result;
}
catch (Exception ex)
{
throw new Exception($"An error occurred refreshing the Xero access token. Reason: {(ex.InnerException == null ? ex.Message : ex.InnerException.Message)}");
}
this.TokenStore.StoreToken(xeroOAuth2Token);
}
return new XeroToken
{
AccessToken = xeroOAuth2Token.AccessToken,
TenantId = Convert.ToString(xeroOAuth2Token.Tenants[0].TenantId)
};
}
SDK 2.2.9
Hi, For unknow reason im starting to get this error now: "An error occurred refreshing the Xero access token. Reason: Parameter is required Parameter name: refresh_token"
Anyone else?
Code im using: