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

401 Invalid timestamp #445

Closed
aunrela opened this issue Apr 6, 2020 · 1 comment
Closed

401 Invalid timestamp #445

aunrela opened this issue Apr 6, 2020 · 1 comment

Comments

@aunrela
Copy link

aunrela commented Apr 6, 2020

Hi,

I just started getting the following error on a previously working setup. I believe Wordpress auto updated over the weekend and think this has brought on the problem.

{'code': 'woocommerce_rest_authentication_error', 'data': {'status': 401}, 'message': 'Invalid timestamp.'}

WordPress version: 5.4
WooCommerce version: 4.0.1
WooCommerceNET version: 0.8.1

Rest documentation says caller and servers’ time zones must be the same.

Setting the PC’s clock to UTC resolves the issue.
For a better fix I added the following Request Filter to the application

private void RequestFilter(System.Net.HttpWebRequest request)
        {
            request.Date = request.Date.ToUniversalTime();
        }

Not sure if this is an issue or just my own misconfiguration, but I figured I would post it incase anyone else has this problem.

@XiaoFaye
Copy link
Owner

XiaoFaye commented Apr 8, 2020

Thanks for the information! This is very helpful for everyone.

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