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

How to deal with "401 JWT expired" #30

Open
DangerLifter opened this issue Mar 24, 2020 · 3 comments
Open

How to deal with "401 JWT expired" #30

DangerLifter opened this issue Mar 24, 2020 · 3 comments
Assignees

Comments

@DangerLifter
Copy link

DangerLifter commented Mar 24, 2020

How to properly deal with "401 JWT expired" in long script?
Injection RefreshToken GrantType in constructor of BolCom\RetailerApi\Client\Oauth2Middleware did not help.

UPDATE: as I found it probably happens after multiple requests and when last returns 429 for the Retry.
Exception: Client error: GET https://api.bol.com/retailer/shipments?page=1&order-id=2547266220` resulted in a 401 JWT expired at 2020-03-24T10:32:19Z. Current time: 2020-03-24T10:33:00Z, a difference of 40501 milliseconds. Allowed clock skew: 1000 milliseconds.: response:
(truncated...)

#0 /var/www/html/bolcom_app_nonarbitrage/vendor/bol-com/retailer-api/src/Client/RequestException.php(47): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /var/www/html/bolcom_app_nonarbitrage/vendor/bol-com/retailer-api/src/Client/RequestExceptionMiddleware.php(25): BolCom\RetailerApi\Client\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#2 /var/www/html/bolcom_app_nonarbitrage/vendor/guzzlehttp/promises/src/Promise.php(203): BolCom\RetailerApi\Client\RequestExceptionMiddleware->BolCom\RetailerApi\Client{closure}(Object(GuzzleHttp\Psr7\Response))
#3 /var/www/html/bolcom_app_nonarbitrage/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)
#4 /var/www/html/bolcom_app_nonarbitrage/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}()
#5 /var/www/html/bolcom_app_nonarbitrage/vendor/guzzlehttp/promises/src/Promise.php(246): GuzzleHttp\Promise\TaskQueue->run(true)
#6 /var/www/html/bolcom_app_nonarbitrage/vendor/guzzlehttp/promises/src/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn()
#7 /var/www/html/bolcom_app_nonarbitrage/vendor/guzzlehttp/promises/src/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending()
#8 /var/www/html/bolcom_app_nonarbitrage/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#9 /var/www/html/bolcom_app_nonarbitrage/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#10 /var/www/html/bolcom_app_nonarbitrage/vendor/guzzlehttp/guzzle/src/Client.php(183): GuzzleHttp\Promise\Promise->wait()
#11 /var/www/html/bolcom_app_nonarbitrage/vendor/guzzlehttp/guzzle/src/Client.php(96): GuzzleHttp\Client->request('get', 'shipments', Array)
#12 /var/www/html/bolcom_app_nonarbitrage/vendor/bol-com/retailer-api/src/Handler/Shipment/GetShipmentListHandler.php(40): GuzzleHttp\Client->__call('get', Array)
`

@nocturnalfrog
Copy link

Is there a solution for this issue yet?
We also run into this problem.

@nocturnalfrog
Copy link

@JeroenVanLeusden,
Any chance you could have a look at this?

@JeroenVanLeusden JeroenVanLeusden self-assigned this Aug 20, 2020
@JeroenVanLeusden
Copy link

Not any time soon, sorry. Will investigate when I've got some time but cannot tell you when exactly. A RefreshToken might work or a retry mechanism has to be implemented I guess.

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

3 participants